diff --git a/Scripts/canonicalize_teams.py b/Scripts/canonicalize_teams.py index 6d6bf2f..62c0e41 100644 --- a/Scripts/canonicalize_teams.py +++ b/Scripts/canonicalize_teams.py @@ -18,7 +18,7 @@ from pathlib import Path from typing import Optional # Import team mappings from scraper -from scrape_schedules import NBA_TEAMS, MLB_TEAMS, NHL_TEAMS +from scrape_schedules import NBA_TEAMS, MLB_TEAMS, NHL_TEAMS, NFL_TEAMS # ============================================================================= @@ -173,6 +173,49 @@ NHL_DIVISIONS = { 'VGK': ('nhl_western', 'nhl_pacific'), } +NFL_DIVISIONS = { + # AFC East + 'BUF': ('nfl_afc', 'nfl_afc_east'), + 'MIA': ('nfl_afc', 'nfl_afc_east'), + 'NE': ('nfl_afc', 'nfl_afc_east'), + 'NYJ': ('nfl_afc', 'nfl_afc_east'), + # AFC North + 'BAL': ('nfl_afc', 'nfl_afc_north'), + 'CIN': ('nfl_afc', 'nfl_afc_north'), + 'CLE': ('nfl_afc', 'nfl_afc_north'), + 'PIT': ('nfl_afc', 'nfl_afc_north'), + # AFC South + 'HOU': ('nfl_afc', 'nfl_afc_south'), + 'IND': ('nfl_afc', 'nfl_afc_south'), + 'JAX': ('nfl_afc', 'nfl_afc_south'), + 'TEN': ('nfl_afc', 'nfl_afc_south'), + # AFC West + 'DEN': ('nfl_afc', 'nfl_afc_west'), + 'KC': ('nfl_afc', 'nfl_afc_west'), + 'LV': ('nfl_afc', 'nfl_afc_west'), + 'LAC': ('nfl_afc', 'nfl_afc_west'), + # NFC East + 'DAL': ('nfl_nfc', 'nfl_nfc_east'), + 'NYG': ('nfl_nfc', 'nfl_nfc_east'), + 'PHI': ('nfl_nfc', 'nfl_nfc_east'), + 'WAS': ('nfl_nfc', 'nfl_nfc_east'), + # NFC North + 'CHI': ('nfl_nfc', 'nfl_nfc_north'), + 'DET': ('nfl_nfc', 'nfl_nfc_north'), + 'GB': ('nfl_nfc', 'nfl_nfc_north'), + 'MIN': ('nfl_nfc', 'nfl_nfc_north'), + # NFC South + 'ATL': ('nfl_nfc', 'nfl_nfc_south'), + 'CAR': ('nfl_nfc', 'nfl_nfc_south'), + 'NO': ('nfl_nfc', 'nfl_nfc_south'), + 'TB': ('nfl_nfc', 'nfl_nfc_south'), + # NFC West + 'ARI': ('nfl_nfc', 'nfl_nfc_west'), + 'LAR': ('nfl_nfc', 'nfl_nfc_west'), + 'SF': ('nfl_nfc', 'nfl_nfc_west'), + 'SEA': ('nfl_nfc', 'nfl_nfc_west'), +} + # ============================================================================= # FUZZY MATCHING @@ -330,6 +373,7 @@ def canonicalize_teams( 'NBA': NBA_DIVISIONS, 'MLB': MLB_DIVISIONS, 'NHL': NHL_DIVISIONS, + 'NFL': NFL_DIVISIONS, }.get(sport, {}) for abbrev, info in team_mappings.items(): @@ -402,6 +446,7 @@ def canonicalize_all_teams( ('NBA', NBA_TEAMS), ('MLB', MLB_TEAMS), ('NHL', NHL_TEAMS), + ('NFL', NFL_TEAMS), ] for sport, team_map in sport_mappings: