Spaces:
Sleeping
Sleeping
Update data/schedule.py
Browse files- data/schedule.py +76 -45
data/schedule.py
CHANGED
|
@@ -1,47 +1,78 @@
|
|
| 1 |
from __future__ import annotations
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from __future__ import annotations
|
| 2 |
|
| 3 |
+
import os
|
| 4 |
+
|
| 5 |
+
APP_TITLE = "WBC Analytics Assistant"
|
| 6 |
+
REFRESH_TTL_SECONDS = 30
|
| 7 |
+
|
| 8 |
+
DUCKDB_PATH = "data/wbc.duckdb"
|
| 9 |
+
|
| 10 |
+
DEFAULT_EDGE_THRESHOLD = 0.05
|
| 11 |
+
DEFAULT_CONFIDENCE_THRESHOLD = 0.70
|
| 12 |
+
|
| 13 |
+
# Official / public sources
|
| 14 |
+
WBC_SCHEDULE_PAGE_URL = "https://www.mlb.com/world-baseball-classic/schedule"
|
| 15 |
+
WBC_HOME_URL = "https://www.mlb.com/world-baseball-classic"
|
| 16 |
+
WBC_STATS_URL = "https://www.mlb.com/world-baseball-classic/stats"
|
| 17 |
+
WBC_STANDINGS_URL = "https://www.mlb.com/world-baseball-classic/standings"
|
| 18 |
+
|
| 19 |
+
# Baseball Savant WBC Statcast
|
| 20 |
+
WBC_STATCAST_SEARCH_URL = "https://baseballsavant.mlb.com/statcast-search-world-baseball-classic"
|
| 21 |
+
STATCAST_SEARCH_URL = "https://baseballsavant.mlb.com/statcast_search/csv"
|
| 22 |
+
|
| 23 |
+
# MLB enrichment / fallback
|
| 24 |
+
MLB_SCHEDULE_URL = "https://statsapi.mlb.com/api/v1/schedule"
|
| 25 |
+
MLB_TEAMS_URL = "https://statsapi.mlb.com/api/v1/teams"
|
| 26 |
+
|
| 27 |
+
# Weather
|
| 28 |
+
OPENWEATHER_URL = "https://api.openweathermap.org/data/2.5/weather"
|
| 29 |
+
|
| 30 |
+
# Odds
|
| 31 |
+
ODDS_SPORT_KEY = "baseball_mlb"
|
| 32 |
+
ODDS_BASE_URL = "https://api.the-odds-api.com/v4"
|
| 33 |
+
ODDS_REGIONS = "us"
|
| 34 |
+
ODDS_FEATURED_MARKETS = "h2h,spreads,totals"
|
| 35 |
+
ODDS_FORMAT = "american"
|
| 36 |
+
|
| 37 |
+
ODDS_API_KEY = os.getenv("ODDS_API_KEY", "")
|
| 38 |
+
OPENWEATHER_API_KEY = os.getenv("OPENWEATHER_API_KEY", "")
|
| 39 |
+
|
| 40 |
+
SUPPORTED_BOOKS = [
|
| 41 |
+
"DraftKings",
|
| 42 |
+
"FanDuel",
|
| 43 |
+
"BetMGM",
|
| 44 |
+
"Caesars",
|
| 45 |
+
"bet365",
|
| 46 |
+
"Pinnacle",
|
| 47 |
+
]
|
| 48 |
+
|
| 49 |
+
WBC_2026_VENUES = {
|
| 50 |
+
"Hiram Bithorn Stadium": {"lat": 18.3982, "lon": -66.0600, "city": "San Juan"},
|
| 51 |
+
"Daikin Park": {"lat": 29.7573, "lon": -95.3555, "city": "Houston"},
|
| 52 |
+
"Tokyo Dome": {"lat": 35.7056, "lon": 139.7519, "city": "Tokyo"},
|
| 53 |
+
"loanDepot park": {"lat": 25.7781, "lon": -80.2197, "city": "Miami"},
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
WBC_TEAMS = [
|
| 57 |
+
"Australia",
|
| 58 |
+
"Brazil",
|
| 59 |
+
"Canada",
|
| 60 |
+
"China",
|
| 61 |
+
"Chinese Taipei",
|
| 62 |
+
"Colombia",
|
| 63 |
+
"Cuba",
|
| 64 |
+
"Czech Republic",
|
| 65 |
+
"Dominican Republic",
|
| 66 |
+
"Great Britain",
|
| 67 |
+
"Israel",
|
| 68 |
+
"Italy",
|
| 69 |
+
"Japan",
|
| 70 |
+
"Korea",
|
| 71 |
+
"Mexico",
|
| 72 |
+
"Netherlands",
|
| 73 |
+
"Nicaragua",
|
| 74 |
+
"Panama",
|
| 75 |
+
"Puerto Rico",
|
| 76 |
+
"United States",
|
| 77 |
+
"Venezuela",
|
| 78 |
+
]
|