Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FLB Analysis — Lebanese Division A (2025–2026)

A full basketball analytics pipeline for the Lebanese Basketball Federation's Division A, built on data scraped directly from RealGM: standings, team power rankings, player efficiency, playing-style profiling, win-correlation analysis, and a statistical player-team fit engine.

View the live report

Sample outputs: player writeups

Two narrative writeups generated from the analysis engine's own numbers — fact-checked against the underlying data before publishing:

What's in the report

  • League standings, team power rankings, and team strength scores
  • What actually correlates with winning (evidence-based, not assumption-based — see caveat in report)
  • Team identity/style profiles (pace, shot profile, ball movement, defensive identity) and each team's statistical needs
  • Team profile vs. roster radar charts for the league's top teams
  • Full player rankings and efficiency rankings, including a Lebanese-players-only breakdown
  • Player-team fit engine: best external targets per team, "hidden gem" recommendations, and underused-player signals from current rosters
  • Home/away splits and head-to-head matchup records

Pipeline

scrape_realgm_*.py          → data/raw/          (Playwright scrapers)
process_realgm_data.py      → data/processed/    (clean season stats)
process_boxscores.py        → data/processed/    (clean per-game box scores)
build_standings.py          → standings_2025_2026.csv
build_team_profiles.py      → team_profiles_2025_2026.csv
rank_teams.py                → team_power_rankings_2025_2026.csv
build_team_strengths.py     → team_strengths_2025_2026.csv
build_win_correlation_analysis.py → win_correlation_analysis_2025_2026.csv
build_team_style_profiles.py → team_style_profiles_2025_2026.csv
build_player_archetypes.py  → player_archetypes_2025_2026.csv
build_player_team_fit.py    → player_team_fit_scores_2025_2026.csv
rank_players.py / rank_player_efficiency.py → player rankings
build_home_away_analysis.py → home_away_analysis_2025_2026.csv
build_matchup_summary.py    → matchup_summary_2025_2026.csv
build_charts.py             → chart PNGs (embedded in report)
generate_html_report.py     → index.html (this report)

Validation scripts (validate_*.py) check for scoring/winner consistency, duplicate games, and missing team mappings.

Notes on methodology

  • All normalized "score" and "tier" fields are relative to this season's 12-team field only — not an absolute or cross-season benchmark.
  • The win-correlation analysis is based on n=12 teams (one season) — treated as a hypothesis to re-check next season, not proven fact.
  • "Lebanese Players" tables use a hand-reviewed name heuristic (RealGM has no nationality field) — see the note in that section of the report.

Tech

Python, pandas, matplotlib, scipy (Pearson/Spearman correlation), Playwright (scraping). Report is a single self-contained HTML file with charts embedded as base64 PNGs — no external dependencies except Google Fonts.

Run it yourself

pip install pandas matplotlib scipy playwright
python scrape_realgm_lebanon.py
python scrape_realgm_games.py
python scrape_realgm_boxscores.py
# ... run remaining build_*.py / rank_*.py scripts in the order above ...
python generate_html_report.py

About

Basketball analytics for the Lebanese Basketball Federation Division A: scrapes, cleans, and analyzes RealGM data to rank teams and players and profile playing styles.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages