
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 deeply nested football event data using a lazy, streaming pipeline built for JSON. Filter, select, flatten, join, group, and summarize large datasets - all without loading everything into memory.
β½ Scrape Data β Collect match statistics from sources like FBRef, Understat, Club Elo, and Fantasy Premier League.
π Model Matches Efficiently β High-performance implementations of Poisson, Bivariate Poisson, Dixon-Coles, and other advanced statistical models, optimized with Cython for rapid analysis.
π° 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.
Take your football analytics and betting strategy to the next level with penaltyblog π
Installation#
pip install penaltyblog
Quick Start - Try it Now!#
Run these examples directly in your browser (no installation required):
Example |
Description |
Colab |
|---|---|---|
Predict Soccer Match Results |
Build a match prediction model from scratch |
|
Process Soccer Data the Easy Way |
Lazy processing of football data using Matchflow |
|
Calculate Massey Ratings |
Calculate teamsβ attack and defense strengths |
|
Use Pi Ratings |
Like Elo ratings, but better |
|
Create Interactive Charts |
Create your own interactive football vizualisations |
|
Work Directly With Statsbomb Data |
Connect directly to Statsbombβs API, including their free open data sets |
Table of Contents
Resources & References