Summary
Add a single operational script that prepares a local MLB Visualizer database for a season without requiring developers to remember multiple import commands.
Proposed command:
poetry run python scripts/bootstrap_season.py --season 2025
Motivation
Local setup currently requires separate commands for migrations, league ingestion, and player catalog ingestion. A bootstrap command would make it much easier to get a development database into a known usable state.
Proposed behavior
For the requested season, the script should:
- Apply Alembic migrations.
- Import the full league season using the existing league ingestion workflow.
- Import the player catalog for that season.
- Print a concise summary of what completed or failed.
The implementation should reuse the existing service-layer functions where possible rather than shelling out to the existing scripts.
Out of scope
Do not automatically import statistics for every individual player. The player catalog should be populated, while individual player-season statistics remain an explicit/on-demand import to avoid a large number of MLB API requests.
Acceptance criteria
Intended local workflow
poetry install
poetry run python scripts/bootstrap_season.py --season 2025
poetry run uvicorn app.main:app --reload
Summary
Add a single operational script that prepares a local MLB Visualizer database for a season without requiring developers to remember multiple import commands.
Proposed command:
Motivation
Local setup currently requires separate commands for migrations, league ingestion, and player catalog ingestion. A bootstrap command would make it much easier to get a development database into a known usable state.
Proposed behavior
For the requested season, the script should:
The implementation should reuse the existing service-layer functions where possible rather than shelling out to the existing scripts.
Out of scope
Do not automatically import statistics for every individual player. The player catalog should be populated, while individual player-season statistics remain an explicit/on-demand import to avoid a large number of MLB API requests.
Acceptance criteria
scripts/bootstrap_season.pyentry point.--season <year>.Intended local workflow