--- phase: 01-script-architecture plan: 02 subsystem: data-pipeline tags: [python, scrapers, modular-architecture, nba, nhl] # Dependency graph requires: [01-01] provides: - nba.py NBA-specific scrapers - nhl.py NHL-specific scrapers affects: [01-03] # Tech tracking tech-stack: added: [] patterns: - "get_{sport}_season_string() for cross-calendar-year seasons (2024-25)" - "Hardcoded stadium data with coordinates as fallback source" key-files: created: - Scripts/nba.py - Scripts/nhl.py modified: [] key-decisions: - "NBA/NHL use season string format (2024-25) for cross-calendar-year seasons" - "Each module has hardcoded stadium list with coordinates as reliable fallback" patterns-established: - "Sport modules follow identical structure: TEAMS dict, scrapers, sources, convenience function" issues-created: [] # Metrics duration: 10min completed: 2026-01-10 --- # Phase 1 Plan 02: NBA + NHL Modules Summary **Extracted NBA and NHL scrapers from monolithic script into dedicated sport modules** ## Performance - **Duration:** 10 min - **Started:** 2026-01-10T06:03:30Z - **Completed:** 2026-01-10T06:13:30Z - **Tasks:** 2 - **Files created:** 2 ## Accomplishments - Created `Scripts/nba.py` with NBA_TEAMS (30 teams), 3 game scrapers, stadium data with coordinates - Created `Scripts/nhl.py` with NHL_TEAMS (32 teams including Utah Hockey Club), 3 game scrapers, stadium data - Both modules follow the mlb.py pattern exactly for consistency ## Task Commits Each task was committed atomically: 1. **Task 1: Create nba.py sport module** - `70acfb7` (feat) 2. **Task 2: Create nhl.py sport module** - `c229fa7` (feat) ## Files Created/Modified - `Scripts/nba.py` - NBA team mappings, Basketball-Reference/ESPN/CBS scrapers, 30 arenas with coordinates - `Scripts/nhl.py` - NHL team mappings, Hockey-Reference/NHL API/ESPN scrapers, 32 arenas with coordinates ## Decisions Made - Used `get_nba_season_string()` and `get_nhl_season_string()` instead of a shared function to maintain module independence - Included Utah Hockey Club (newest NHL team) in team mappings ## Deviations from Plan None - plan executed exactly as written. ## Issues Encountered None ## Next Phase Readiness - core.py, mlb.py, nba.py, nhl.py all complete - Ready for 01-03-PLAN.md (nfl.py + orchestrator refactor) --- *Phase: 01-script-architecture* *Completed: 2026-01-10*