Skip to main content

Library from http://pena.lt/y/blog for scraping and modelling football (soccer) data

Project description

Penalty Blog

Penalty Blog Logo

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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

penaltyblog-1.0.2.tar.gz (36.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

penaltyblog-1.0.2-py3-none-any.whl (51.4 kB view details)

Uploaded Python 3

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

Hashes for penaltyblog-1.0.2.tar.gz
Algorithm Hash digest
SHA256 7eb80fe5c4dc981554e69cf81bb638343ca23a598fb9ef7b98e7258dca25eb38
MD5 0d55ee86adfde1650be124de95aa04c2
BLAKE2b-256 7cdc5120c2b4273bee6f32fe13772307af043e092e918f88596a4f40cd7bb1a2

See more details on using hashes here.

Provenance

The following attestation bundles were made for penaltyblog-1.0.2.tar.gz:

Publisher: publish.yml on martineastwood/penaltyblog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for penaltyblog-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1e04f6a94c1c29c8d953aac3fd0e263810419a00661273bb7548468adb6e66c1
MD5 543babf7111f0ee300ef2bd67bc49fd0
BLAKE2b-256 5cc8670dca65c49f9d2b7c2c8327de2f534402f08b2a592ed6c3bac40f4d69d5

See more details on using hashes here.

Provenance

The following attestation bundles were made for penaltyblog-1.0.2-py3-none-any.whl:

Publisher: publish.yml on martineastwood/penaltyblog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page