RepositoryPythonGBUnited Kingdom
martineastwood

martineastwood/penaltyblog

⚽ High-performance football analytics: build data pipelines, scrape data, model matches, rank teams, and bet smarter | Powered by www.pena.lt/y 🚀

249stars
41forks
1issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: football-data

#1 Repository of the week

1
TINIX TRENDING·Topic: elo-rating

#1 Repository of the week

1
TINIX TRENDING·Topic: match-predictions

#1 Repository of the week

Penalty Blog

Penalty Blog Logo

penaltyblog: Football Data & Modelling Made Easy

penaltyblog is a production-ready Python package designed for football (soccer) analytics, providing powerful tools from pena.lt/y/blog for data analysis, outcome modelling, and betting insights. Optimized with Cython, penaltyblog delivers high-performance modelling to power faster, efficient predictions.

Features

  • 🔄 Streamline JSON Workflows with MatchFlow: Process nested football data using a lazy, streaming pipeline built for JSON. Filter, select, flatten, join, group, and summarize large datasets without loading everything into memory.
  • 🔌 Connect to Professional APIs: Seamlessly stream and filter data directly from industry leaders, like StatsBomb and Opta. Query matches, events, and stats using lazy loading without handling massive JSON dumps.
  • 📊 Model Matches Efficiently: High-performance implementations of Poisson, Bivariate Poisson, Dixon-Coles, and other advanced statistical models, optimized with Cython for rapid analysis.
  • 🧠 Advanced Bayesian Modelling: Full posterior distributions for match outcomes using MCMC sampling. Includes Hierarchical Bayesian models to automatically learn league-wide variances and handle parameter uncertainty.
  • ⚽ Scrape Data: Collect match statistics from sources like Understat, Club Elo, and Fantasy Premier League.
  • 💰 Bet Smarter: Precisely estimate probabilities for Asian handicaps, over/under totals, match outcomes, and more.
  • 🏆 Rank Teams: Evaluate team strengths with sophisticated methods including Elo, Massey, Colley, and Pi ratings.
  • 📈 Decode Bookmaker Odds: Accurately extract implied probabilities by removing bookmaker margins (overrounds).
  • 🎯 Fantasy Football Optimisation: Mathematically optimize your fantasy football squad to maximize performance.
  • 🎨 Visualize with Style: Create publication-ready pitch visualizations and data flow diagrams with customizable themes, supporting multiple data providers and flexible layouts.

Take your football analytics and betting strategy to the next level with penaltyblog 🚀

Installation

pip install penaltyblog

Agent Support

If you are using a coding agent such as Claude Code, Cursor, or Copilot, the repository includes a skill file at .claude/skills/penaltyblog/SKILL.md that gives your agent full context about the penaltyblog API. The file is self-contained and covers all public modules — no additional files are needed.

🚀 Quick Start - Try it Now!

Run these examples directly in your browser (no installation required):

ExampleDescriptionColab
Predict Soccer Match ResultsBuild a match prediction model from scratchOpen In Colab
Process Soccer Data the Easy WayLazy processing of football data using MatchflowOpen In Colab
Calculate Massey RatingsCalculate teams' attack and defense strengthsOpen In Colab
Use Pi RatingsLike Elo ratings, but betterOpen In Colab
Create Interactive ChartsCreate your own interactive football vizualisationsOpen In Colab
Work Directly With Statsbomb DataConnect directly to Statsbomb's API, including their free open data setsOpen In Colab
Calculate Implied ProbabilitiesCalculate implied probabilities from bookmaker's oddsOpen In Colab
Calculate Expected Threat (xT)Calculate xT from event dataOpen In Colab

Documentation

Learn more about how to utilize penaltyblog by exploring the official documentation and detailed examples:

Why Penaltyblog?

Unlike many football analytics resources that are academic, one-off, or hard to scale, penaltyblog is designed from the ground up to be production-ready, performance-optimized, and practically useful.

It combines advanced statistical models (including Bayesian and Hierarchical Bayesian variants), efficient implementations (via Cython), and real-world workflows, from scraping public data to modelling outcomes and optimising fantasy teams.

The project is maintained by Martin Eastwood, a data scientist focused on the intersection of high-performance computing and sports analytics. penaltyblog aims to provide the community with a robust, audited foundation for advanced modeling.

Community & Contributions

I am always interested in seeing how penaltyblog is being applied in research and industry. If you have feedback, bug reports, or want to collaborate on new features, feel free to:

Similar Projects

Discover other similar projects and AI models.

RepositoryGo
0xjuanma/golazo

The beautiful game in your terminal. Minimal TUI app to keep up with live & recent football/soccer matches written in Go.

899
Nov 28, 2026
Repository
martj42/international_results

No description provided.

534
Nov 23, 2026
RepositoryHTML
jfjelstul/worldcup

A Comprehensive Database on the FIFA World Cup (Men's and Women's)

343
Jun 11, 2026
RepositoryTypeScript
withqwerty/reep

The football entity register. Maps player, team, and coach identities across Transfermarkt, FBref, UEFA, Sofascore, and 25+ data providers.

246
Aug 20, 2026
RepositoryPython
scikit-learn/scikit-learn

scikit-learn: machine learning in Python

68.4k
Dec 1, 2026
RepositoryPython
TheAlgorithms/Python

All Algorithms implemented in Python

226.6k
Nov 13, 2026
RepositoryJupyter Notebook
microsoft/ML-For-Beginners

12 weeks, 26 lessons, 52 quizzes, classic Machine Learning for all

92.5k
Nov 7, 2026
RepositoryPython
roboflow/sports

computer vision and sports

5.5k
Nov 27, 2026
RepositoryPython
probberechts/soccerdata

⛏⚽ Scrape soccer data from Club Elo, ESPN, FBref, Football-Data.co.uk, Sofascore, SoFIFA, Understat and WhoScored.

2.1k
Nov 21, 2026