An end-to-end football analytics project: scrape player stats from FBref, then explore them in an interactive Streamlit dashboard.
| Step | File | Description |
|---|---|---|
| Scrape | scraper.py |
Pulls 2025-26 PL player stats from FBref via soccerdata. Downloads to CSV; subsequent runs read from cache. |
| Explore | dashboard.py |
Streamlit app with sidebar filters (club, position, min 90s) and three tabs: Overview, Shooting, Discipline. |
# 1. Install dependencies
pip install soccerdata streamlit plotly
# 2. Download the data (only needed once; results are cached)
python scraper.py
# 3. Launch the dashboard
streamlit run dashboard.pyThen open http://localhost:8501.
Overview — G+A leaderboard, Goals vs Assists scatter, full sortable table
Shooting — Shot volume vs goals, conversion rate (G/Sh) leaders, shooting table
Discipline — Yellow card leaders, Fouls vs Interceptions scatter, cards-per-90 table
Stats come from FBref (Sports Reference) via the soccerdata library, which handles rate-limiting and on-disk caching automatically. Three stat categories are currently scraped:
| File | Contents |
|---|---|
pl_standard.csv |
Appearances, goals, assists, cards |
pl_shooting.csv |
Shots, shots on target, conversion rates |
pl_misc.csv |
Fouls, interceptions, tackles, crosses |
Extending the data:
soccerdataalso supportskeeperandplaying_time. For passing, GCA, defense, and possession stats, see the Playwright-based scraper preserved in the git history, or the R package worldfootballR.
Football-data/
├── scraper.py # data collection
├── dashboard.py # Streamlit app
├── pl_standard.csv
├── pl_shooting.csv
├── pl_misc.csv
└── README.md