{"id":50447214,"url":"https://github.com/gmalbert/rugby","last_synced_at":"2026-05-31T22:04:04.224Z","repository":{"id":354072460,"uuid":"1221660311","full_name":"gmalbert/rugby","owner":"gmalbert","description":"Rugby Data Analysis and Sports Betting","archived":false,"fork":false,"pushed_at":"2026-05-27T04:34:21.000Z","size":1014,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-27T06:22:11.484Z","etag":null,"topics":["data-analysis","rugby","sports-betting"],"latest_commit_sha":null,"homepage":"http://www.scrumbet.com","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gmalbert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-26T14:15:22.000Z","updated_at":"2026-05-27T04:34:25.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gmalbert/rugby","commit_stats":null,"previous_names":["gmalbert/rugby"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gmalbert/rugby","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmalbert%2Frugby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmalbert%2Frugby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmalbert%2Frugby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmalbert%2Frugby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gmalbert","download_url":"https://codeload.github.com/gmalbert/rugby/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gmalbert%2Frugby/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33750494,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-31T02:00:06.040Z","response_time":95,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["data-analysis","rugby","sports-betting"],"created_at":"2026-05-31T22:04:02.367Z","updated_at":"2026-05-31T22:04:04.210Z","avatar_url":"https://github.com/gmalbert.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ScrumBet 🏉\n\nEuropean rugby analytics and DraftKings betting intelligence, built with Streamlit.\n\n## Overview\n\nScrumBet is a multi-page Streamlit app that combines live scraped data from five sources with\nthree predictive models (Elo, Dixon-Coles, Try Scorer) to surface match previews, player\nstats, and value-bet opportunities across six major European and international rugby\ncompetitions.\n\n## Pages\n\n### Home (`predictions.py`)\n- **This Week's Fixtures** — upcoming matches grouped by day with kickoff time, venue, and DK moneylines\n- **Live Ticker** — real-time scores via SofaScore; falls back to pipeline data when unavailable\n- **DK Odds Snapshot** — compact moneyline + total table for next 7 days\n- **Top Try Scorers** — league-filtered season leaderboard across all competitions\n- **Team Form Strip** — last-5 result badges (W/D/L) for every team in the current fixture list\n- Global sidebar: logo, theme selector, cache-refresh button, data-source credits\n\n### 1 – League Overview (`pages/1_League_Overview.py`)\n- **Standings table** — P/W/L/D, points for/against, try diff, bonus points, league points, form arrow\n- **Attack Efficiency scatter** — Points per Game vs Tries per Game with quadrant lines at the mean\n- **Home vs Away bar charts** — average points scored at home and away per team\n- **Round-by-Round Results grid** — pivot table of scores by round\n- **Upcoming Fixtures** — date, teams, venue, round, and DK odds (ML + O/U) when available\n- **Season Snapshot** — auto-generated narrative (leader, gap at top, top attacker, best defence)\n\n### 2 – Team Deep Dive (`pages/2_Team_Deep_Dive.py`)\n- **Form Strip** — last 10 results with colour-coded badges and opponent/score labels\n- **Attack vs Defence Radar** — five-axis radar: tries scored, tries conceded, metres, linebreaks, tackles\n- **Elo Rating History** — line chart of the team's Elo trajectory across all recorded matches\n- **Scoring Breakdown** — bar chart splitting season points into try-derived vs penalties/drops\n- **Key Players** — top 5 try scorers, metres carriers, and tacklers in three side-by-side tables\n- **Head-to-Head** — last 10 meetings vs any selected opponent with W/D/L result column\n- **Venue Stats** — home/away split: games, wins, average points for/against\n\n### 3 – Player Stats (`pages/3_Player_Stats.py`)\n- **Try Scorer Rankings** — sortable table: tries, games, tries-per-game, last-3 tries; filterable by league and position\n- **Player Profile** — metrics card (team, position, season tries, T/game, consistency %, avg minutes); tries-by-round bar chart; minutes-played trend\n- **Prop Bet Analyzer** — enter a DraftKings American-odds line; model computes historical scoring rate, implied probability, expected value, and Kelly Criterion stake recommendation\n\n### 4 – Match Analysis (`pages/4_Match_Analysis.py`)\n- **Win Probabilities** — horizontal probability bar chart from Dixon-Coles (primary) or Elo (fallback)\n- **Predicted Scoreline** — expected points for each team and top-5 most likely scorelines with probabilities\n- **Scoreline Distribution Heatmap** — Dixon-Coles joint Poisson matrix up to 40 pts per side\n- **Head-to-Head** — last 5 meetings between the two selected teams\n- **Key Stats Comparison** — 8-metric side-by-side table: win%, pts/game, tries/game, tries conceded/game, metres, linebreaks, tackles, missed tackles\n- **Predicted Try Scorers** — top-5 anytime try scorer probabilities from the logistic regression model\n- **DK Odds vs Model** — edge table for home ML, away ML, and total line with signal (✅ Back / 🔴 Under / 🔴 Fade)\n- **Venue Weather** — current conditions at kickoff venue via OpenWeatherMap (optional, requires `OPENWEATHER_API_KEY`)\n\n### 5 – Betting Edge (`pages/5_Betting_Edge.py`)\n- **Value Bets** — Elo-implied vs DK-implied probability for every upcoming fixture; colour-coded rows (green = back, red = fade); configurable minimum edge threshold\n- **Try Scorer Value** — model probability and fair-value American odds for anytime try scorer across all upcoming games\n- **Totals Analysis** — Dixon-Coles expected total vs DK O/U line with Over/Under signal\n- **Parlay Builder** — select any combination of Elo-ranked match-winner legs; displays combined model probability and fair-value American parlay odds\n- **Historical Edge Tracking** — placeholder section; will show ROI, strike rate, and calibration by market type as results accumulate\n\n### 6 – Model Lab (`pages/6_Model_Lab.py`)\n- **Elo Leaderboard** — current ratings for all teams with league, 3-match trend arrow, and sortable table; per-team Elo history line chart\n- **Dixon-Coles Parameters** — home advantage and ρ (low-scoring correction) values; attack/defence rating table; attack-vs-defence scatter plot\n- **Backtesting** — walk-forward evaluation: % correct winner, Brier score, number of test matches, calibration scatter (predicted vs actual home win rate)\n- **Manual Override** — adjust any two teams' Elo ratings by ±200 points to simulate injury news; re-runs win probability instantly\n- **Monte Carlo Simulation** — Poisson draws (1 000–10 000); outputs win/draw/loss %, total-points histogram, and winning-margin histogram\n\n## Data Sources\n\n| Source | Used For |\n|---|---|\n| ESPN API | Fixtures, results, scores, league standings |\n| RugbyPass | Supplementary match metadata |\n| SofaScore | Live scores, player statistics (tries, metres, tackles, linebreaks, minutes) |\n| World Rugby | Official rankings |\n| The Odds API | DraftKings moneylines, totals, and try scorer props |\n\n## Models\n\n| Model | Details |\n|---|---|\n| **Elo** | K = 32, home advantage = +50, margin-weighted updates. Ratings stored per match in `data_files/`. Used for win probability, backtesting, and parlay builder. |\n| **Dixon-Coles** | Bivariate Poisson with low-scoring correction (ρ). Fitted via `scipy.optimize.minimize`. Requires ≥ 15 completed matches. Outputs attack/defence ratings, win/draw/loss probabilities, and full scoreline matrix. |\n| **Try Scorer** | Random Forest on player features: tries-per-game, position, home/away, minutes. Trained on all completed match data; requires ≥ 20 matches. |\n| **Value Finder** | Compares Elo/DC model probabilities to DK implied probabilities; identifies edges above a configurable threshold. |\n\n## Leagues Covered\n\nSix Nations · Premiership Rugby · Top 14 · Super Rugby Pacific · United Rugby Championship · European Champions Cup\n\n## Tech Stack\n\n| Layer | Library |\n|---|---|\n| Frontend | Streamlit (multi-page, wide layout, dark/light themes) |\n| Data | pandas, pyarrow (Parquet + CSV dual-write) |\n| Models | scipy, scikit-learn, numpy |\n| Charts | Plotly Express |\n| Scrapers | requests, ESPN API, SofaScore API, The Odds API |\n| Pipeline | Python script + GitHub Actions cron (daily 03:00 UTC) |\n| Config | python-dotenv (`.env` for API keys) |\n\n\n## Disclaimer\n\nScrumBet is an informational analytics tool only. Nothing here constitutes financial or gambling advice.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmalbert%2Frugby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgmalbert%2Frugby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgmalbert%2Frugby/lists"}