Library from http://pena.lt/y/blog for scraping and modelling football (soccer) data
Project description
Penalty Blog
The penaltyblog Python package contains lots of useful code from pena.lt/y/blog for working with football (soccer) data.
penaltyblog includes functions for:
- Scraping football data from sources such as football-data.co.uk, FBRef, Club Elo, Understat and Fantasy Premier League
- Modelling of football matches using Poisson-based models, such as Dixon and Coles, and Bayesian models
- Predicting probabilities for many betting markets, e.g. Asian handicaps, over/under, total goals etc
- Modelling football team's abilities using Massey ratings, Colley ratings and Elo ratings
- Estimating the implied odds from bookmaker's odds by removing the overround using multiple different methods
- Estimating goal expectancy from bookmaker's odds
- Mathematically optimising your fantasy football team
Installation
pip install penaltyblog
Stan
The Bayesian models in penaltyblog require the Stan probabilistic programming language to function. You can use the following command to install Stan directly from the penaltyblog package:
import penaltyblog as pb
pb.install_stan()
Documentation
To learn how to use penaltyblog, you can read the documentation and look at the
examples for:
- Scraping football data
- Predicting football matches and betting markets
- Estimating the implied odds from bookmakers odds
- Calculate Massey, Colley and Elo ratings
References
- Mark J. Dixon and Stuart G. Coles (1997) Modelling Association Football Scores and Inefficiencies in the Football Betting Market
- Håvard Rue and Øyvind Salvesen (1999) Prediction and Retrospective Analysis of Soccer Matches in a League
- Anthony C. Constantinou and Norman E. Fenton (2012) Solving the problem of inadequate scoring rules for assessing probabilistic football forecast models
- Hyun Song Shin (1992) Prices of State Contingent Claims with Insider Traders, and the Favourite-Longshot Bias
- Hyun Song Shin (1993) Measuring the Incidence of Insider Trading in a Market for State-Contingent Claims
- Joseph Buchdahl (2015) The Wisdom of the Crowd
- Gianluca Baio and Marta A. Blangiardo (2010) Bayesian Hierarchical Model for the Prediction of Football Results
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file penaltyblog-1.0.2.tar.gz.
File metadata
- Download URL: penaltyblog-1.0.2.tar.gz
- Upload date:
- Size: 36.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7eb80fe5c4dc981554e69cf81bb638343ca23a598fb9ef7b98e7258dca25eb38
|
|
| MD5 |
0d55ee86adfde1650be124de95aa04c2
|
|
| BLAKE2b-256 |
7cdc5120c2b4273bee6f32fe13772307af043e092e918f88596a4f40cd7bb1a2
|
Provenance
The following attestation bundles were made for penaltyblog-1.0.2.tar.gz:
Publisher:
publish.yml on martineastwood/penaltyblog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
penaltyblog-1.0.2.tar.gz -
Subject digest:
7eb80fe5c4dc981554e69cf81bb638343ca23a598fb9ef7b98e7258dca25eb38 - Sigstore transparency entry: 156440534
- Sigstore integration time:
-
Permalink:
martineastwood/penaltyblog@ff5781e1b74453e78527ad0fbee50b9cb959d638 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/martineastwood
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ff5781e1b74453e78527ad0fbee50b9cb959d638 -
Trigger Event:
release
-
Statement type:
File details
Details for the file penaltyblog-1.0.2-py3-none-any.whl.
File metadata
- Download URL: penaltyblog-1.0.2-py3-none-any.whl
- Upload date:
- Size: 51.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e04f6a94c1c29c8d953aac3fd0e263810419a00661273bb7548468adb6e66c1
|
|
| MD5 |
543babf7111f0ee300ef2bd67bc49fd0
|
|
| BLAKE2b-256 |
5cc8670dca65c49f9d2b7c2c8327de2f534402f08b2a592ed6c3bac40f4d69d5
|
Provenance
The following attestation bundles were made for penaltyblog-1.0.2-py3-none-any.whl:
Publisher:
publish.yml on martineastwood/penaltyblog
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
penaltyblog-1.0.2-py3-none-any.whl -
Subject digest:
1e04f6a94c1c29c8d953aac3fd0e263810419a00661273bb7548468adb6e66c1 - Sigstore transparency entry: 156440536
- Sigstore integration time:
-
Permalink:
martineastwood/penaltyblog@ff5781e1b74453e78527ad0fbee50b9cb959d638 -
Branch / Tag:
refs/tags/v1.0.2 - Owner: https://github.com/martineastwood
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ff5781e1b74453e78527ad0fbee50b9cb959d638 -
Trigger Event:
release
-
Statement type: