penaltyblog


Namepenaltyblog JSON
Version 1.0.4 PyPI version JSON
download
home_pageNone
SummaryLibrary from http://pena.lt/y/blog for scraping and modelling football (soccer) data
upload_time2025-01-10 19:42:35
maintainerNone
docs_urlNone
authorNone
requires_python>=3.10
licenseNone
keywords football soccer goals modelling dixon coles poisson bayesian scraper scraping backtest
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            <img src="https://raw.githubusercontent.com/martineastwood/penaltyblog/refs/heads/master/logo.png" width="0" height="0" style="display:none;"/>

<meta property="og:image" content="https://raw.githubusercontent.com/martineastwood/penaltyblog/refs/heads/master/logo.png" />
<meta property="og:image:alt" content="penaltyblog python package for soccer modeling" />
<meta name="twitter:image" content="https://raw.githubusercontent.com/martineastwood/penaltyblog/refs/heads/master/logo.png">
<meta name="twitter:card" content="summary_large_image">

# Penalty Blog

<div align="center">

  <a href="">[![Python Version](https://img.shields.io/pypi/pyversions/penaltyblog)](https://pypi.org/project/penaltyblog/)</a>
<a href="https://codecov.io/github/martineastwood/penaltyblog" >
<img src="https://codecov.io/github/martineastwood/penaltyblog/branch/master/graph/badge.svg?token=P0WDHRGIG2"/>
</a>
  <a href="">[![PyPI](https://img.shields.io/pypi/v/penaltyblog.svg)](https://pypi.org/project/penaltyblog/)</a>
  <a href="">[![Downloads](https://static.pepy.tech/badge/penaltyblog)](https://pepy.tech/project/penaltyblog)</a>
  <a href="">[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)</a>
  <a href="">[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)</a>
  <a href="">[![Code style: pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)</a>

</div>


<div align="center">
  <img src="logo.png" alt="Penalty Blog Logo" width="200">
</div>



The **penaltyblog** Python package contains lots of useful code from [pena.lt/y/blog](http://pena.lt/y/blog.html) 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](https://mc-stan.org/) to function. You can use the following command to install Stan directly from the penaltyblog package:

```python
import penaltyblog as pb

pb.install_stan()
```

## Documentation

To learn how to use `penaltyblog`, you can read the [documentation](https://penaltyblog.readthedocs.io/en/stable/) and look at the
examples for:

- [Scraping football data](https://penaltyblog.readthedocs.io/en/stable/scrapers/index.html)
- [Predicting football matches and betting markets](https://penaltyblog.readthedocs.io/en/stable/models/index.html)
- [Estimating the implied odds from bookmakers odds](https://penaltyblog.readthedocs.io/en/stable/implied/index.html)
- [Calculate Massey, Colley and Elo ratings](https://penaltyblog.readthedocs.io/en/stable/ratings/index.html)

## 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

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "penaltyblog",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.10",
    "maintainer_email": null,
    "keywords": "football, soccer, goals, modelling, dixon coles, poisson, bayesian, scraper, scraping, backtest",
    "author": null,
    "author_email": "Martin Eastwood <martin.eastwood@gmx.com>",
    "download_url": "https://files.pythonhosted.org/packages/a7/f6/382c9bed0374bee62a5c0562b4d2f3ec22fd00165c9d0e041ab9c8a2f15b/penaltyblog-1.0.4.tar.gz",
    "platform": null,
    "description": "<img src=\"https://raw.githubusercontent.com/martineastwood/penaltyblog/refs/heads/master/logo.png\" width=\"0\" height=\"0\" style=\"display:none;\"/>\n\n<meta property=\"og:image\" content=\"https://raw.githubusercontent.com/martineastwood/penaltyblog/refs/heads/master/logo.png\" />\n<meta property=\"og:image:alt\" content=\"penaltyblog python package for soccer modeling\" />\n<meta name=\"twitter:image\" content=\"https://raw.githubusercontent.com/martineastwood/penaltyblog/refs/heads/master/logo.png\">\n<meta name=\"twitter:card\" content=\"summary_large_image\">\n\n# Penalty Blog\n\n<div align=\"center\">\n\n  <a href=\"\">[![Python Version](https://img.shields.io/pypi/pyversions/penaltyblog)](https://pypi.org/project/penaltyblog/)</a>\n<a href=\"https://codecov.io/github/martineastwood/penaltyblog\" >\n<img src=\"https://codecov.io/github/martineastwood/penaltyblog/branch/master/graph/badge.svg?token=P0WDHRGIG2\"/>\n</a>\n  <a href=\"\">[![PyPI](https://img.shields.io/pypi/v/penaltyblog.svg)](https://pypi.org/project/penaltyblog/)</a>\n  <a href=\"\">[![Downloads](https://static.pepy.tech/badge/penaltyblog)](https://pepy.tech/project/penaltyblog)</a>\n  <a href=\"\">[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)</a>\n  <a href=\"\">[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)</a>\n  <a href=\"\">[![Code style: pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)</a>\n\n</div>\n\n\n<div align=\"center\">\n  <img src=\"logo.png\" alt=\"Penalty Blog Logo\" width=\"200\">\n</div>\n\n\n\nThe **penaltyblog** Python package contains lots of useful code from [pena.lt/y/blog](http://pena.lt/y/blog.html) for working with football (soccer) data.\n\n**penaltyblog** includes functions for:\n\n- Scraping football data from sources such as football-data.co.uk, FBRef, Club Elo, Understat and Fantasy Premier League\n- Modelling of football matches using Poisson-based models, such as Dixon and Coles, and Bayesian models\n- Predicting probabilities for many betting markets, e.g. Asian handicaps, over/under, total goals etc\n- Modelling football team's abilities using Massey ratings, Colley ratings and Elo ratings\n- Estimating the implied odds from bookmaker's odds by removing the overround using multiple different methods\n- Estimating goal expectancy from bookmaker's odds\n- Mathematically optimising your fantasy football team\n\n## Installation\n\n`pip install penaltyblog`\n\n\n## Stan\n\nThe Bayesian models in `penaltyblog` require the [Stan probabilistic programming language](https://mc-stan.org/) to function. You can use the following command to install Stan directly from the penaltyblog package:\n\n```python\nimport penaltyblog as pb\n\npb.install_stan()\n```\n\n## Documentation\n\nTo learn how to use `penaltyblog`, you can read the [documentation](https://penaltyblog.readthedocs.io/en/stable/) and look at the\nexamples for:\n\n- [Scraping football data](https://penaltyblog.readthedocs.io/en/stable/scrapers/index.html)\n- [Predicting football matches and betting markets](https://penaltyblog.readthedocs.io/en/stable/models/index.html)\n- [Estimating the implied odds from bookmakers odds](https://penaltyblog.readthedocs.io/en/stable/implied/index.html)\n- [Calculate Massey, Colley and Elo ratings](https://penaltyblog.readthedocs.io/en/stable/ratings/index.html)\n\n## References\n\n- Mark J. Dixon and Stuart G. Coles (1997) Modelling Association Football Scores and Inefficiencies in the Football Betting Market\n- H\u00e5vard Rue and \u00d8yvind Salvesen (1999) Prediction and Retrospective Analysis of Soccer Matches in a League\n- Anthony C. Constantinou and Norman E. Fenton (2012) Solving the problem of inadequate scoring rules for assessing probabilistic football forecast models\n- Hyun Song Shin (1992) Prices of State Contingent Claims with Insider Traders, and the Favourite-Longshot Bias\n- Hyun Song Shin (1993) Measuring the Incidence of Insider Trading in a Market for State-Contingent Claims\n- Joseph Buchdahl (2015) The Wisdom of the Crowd\n- Gianluca Baio and Marta A. Blangiardo (2010) Bayesian Hierarchical Model for the Prediction of Football Results\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Library from http://pena.lt/y/blog for scraping and modelling football (soccer) data",
    "version": "1.0.4",
    "project_urls": {
        "Homepage": "https://github.com/martineastwood/penaltyblog",
        "Repository": "https://github.com/martineastwood/penaltyblog"
    },
    "split_keywords": [
        "football",
        " soccer",
        " goals",
        " modelling",
        " dixon coles",
        " poisson",
        " bayesian",
        " scraper",
        " scraping",
        " backtest"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8f1765f06ae01ac13f1e1520bdc90277ca576cebc40ba793841787136792cecb",
                "md5": "55aa90a0d27dd11979ed71bdc135ba61",
                "sha256": "1a7eeac084907ac129ced35cef73a301468a488f3d5df9096ff19e69978ccb5a"
            },
            "downloads": -1,
            "filename": "penaltyblog-1.0.4-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "55aa90a0d27dd11979ed71bdc135ba61",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.10",
            "size": 52208,
            "upload_time": "2025-01-10T19:42:32",
            "upload_time_iso_8601": "2025-01-10T19:42:32.768075Z",
            "url": "https://files.pythonhosted.org/packages/8f/17/65f06ae01ac13f1e1520bdc90277ca576cebc40ba793841787136792cecb/penaltyblog-1.0.4-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a7f6382c9bed0374bee62a5c0562b4d2f3ec22fd00165c9d0e041ab9c8a2f15b",
                "md5": "a9126ec94901400cab25d5522d8c58fc",
                "sha256": "abd9050a760e58de400bb36c79975089333aee44865e262dd2012f7be2df7db2"
            },
            "downloads": -1,
            "filename": "penaltyblog-1.0.4.tar.gz",
            "has_sig": false,
            "md5_digest": "a9126ec94901400cab25d5522d8c58fc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.10",
            "size": 36923,
            "upload_time": "2025-01-10T19:42:35",
            "upload_time_iso_8601": "2025-01-10T19:42:35.330188Z",
            "url": "https://files.pythonhosted.org/packages/a7/f6/382c9bed0374bee62a5c0562b4d2f3ec22fd00165c9d0e041ab9c8a2f15b/penaltyblog-1.0.4.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-10 19:42:35",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "martineastwood",
    "github_project": "penaltyblog",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "penaltyblog"
}
        
Elapsed time: 0.40161s