from __future__ import annotations import os APP_TITLE = "Kasper" REFRESH_TTL_SECONDS = 30 LIVE_FEED_TTL_SECONDS = 5 SCORES_TTL_SECONDS = 8 SCHEDULE_TTL_SECONDS = 300 STATCAST_TTL_SECONDS = 600 ENABLE_ENTERPRISE_PROVIDER = False # Batch 12.5C: XGBoost shadow inference # Set ENABLE_XGB_SHADOW=false in env to disable (default: enabled) ENABLE_XGB_SHADOW = os.getenv("ENABLE_XGB_SHADOW", "true").lower() == "true" LIVE_PROP_ODDS_TTL_SECONDS = 20 DEFAULT_PROP_BOOKS = ["draftkings", "fanduel", "betmgm", "williamhill_us"] DEFAULT_PROP_MARKETS = ["batter_home_runs", "batter_hits", "batter_total_bases"] DEFAULT_UPCOMING_PROP_MARKETS = ["batter_home_runs", "pitcher_strikeouts", "pitcher_strikeouts_alternate"] # Phase 2: Baseline HR probability (empirical MLB 2024 per-PA HR rate ≈ 0.036) BASELINE_HR_PROB = 0.036 BASELINE_HIT_PROB = 0.24 # Phase 3: Vig margin for single-sided HR props (empirical Pinnacle overround) VIG_MARGIN_HR_PROPS = 0.055 # Phase 5: Recommendation tier thresholds DEFAULT_EDGE_THRESHOLD = 0.03 DEFAULT_CONFIDENCE_THRESHOLD = 0.60 # Phase 6: XGBoost production blend ENABLE_XGB_PRODUCTION_BLEND = os.getenv("ENABLE_XGB_PRODUCTION_BLEND", "true").lower() == "true" XGB_BLEND_WEIGHT = 0.20 # Phase 8: Batter trend minimum pitch events TREND_MIN_PITCH_EVENTS = 15 WBC_SCHEDULE_PAGE_URL = "https://www.mlb.com/world-baseball-classic/schedule" WBC_HOME_URL = "https://www.mlb.com/world-baseball-classic" WBC_STATS_URL = "https://www.mlb.com/world-baseball-classic/stats" WBC_STANDINGS_URL = "https://www.mlb.com/world-baseball-classic/standings" WBC_STATCAST_SEARCH_URL = "https://baseballsavant.mlb.com/statcast-search-world-baseball-classic" STATCAST_SEARCH_URL = "https://baseballsavant.mlb.com/statcast_search/csv" MLB_SCHEDULE_URL = "https://statsapi.mlb.com/api/v1/schedule" MLB_TEAMS_URL = "https://statsapi.mlb.com/api/v1/teams" OPENWEATHER_URL = "https://api.openweathermap.org/data/2.5/weather" ODDS_SPORT_KEY = "baseball_mlb" ODDS_BASE_URL = "https://api.the-odds-api.com/v4" ODDS_REGIONS = "us" ODDS_FEATURED_MARKETS = "h2h,spreads,totals" ODDS_FORMAT = "american" ODDS_API_KEY = os.getenv("ODDS_API_KEY", "") OPENWEATHER_API_KEY = os.getenv("OPENWEATHER_API_KEY", "") SUPPORTED_BOOKS = [ "DraftKings", "FanDuel", "BetMGM", "Caesars", "bet365", "Pinnacle", ] WBC_2026_VENUES = { "Hiram Bithorn Stadium": {"lat": 18.3982, "lon": -66.0600, "city": "San Juan"}, "Daikin Park": {"lat": 29.7573, "lon": -95.3555, "city": "Houston"}, "Tokyo Dome": {"lat": 35.7056, "lon": 139.7519, "city": "Tokyo"}, "loanDepot park": {"lat": 25.7781, "lon": -80.2197, "city": "Miami"}, } WBC_TEAMS = [ "Australia", "Brazil", "Canada", "China", "Chinese Taipei", "Colombia", "Cuba", "Czech Republic", "Dominican Republic", "Great Britain", "Israel", "Italy", "Japan", "Korea", "Mexico", "Netherlands", "Nicaragua", "Panama", "Puerto Rico", "United States", "Venezuela", ]