sportsball


Namesportsball JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/8W9aG/sportsball
SummaryA library for pulling in and normalising sports stats.
upload_time2024-03-14 12:43:30
maintainer
docs_urlNone
authorWill Sackfield
requires_python
licenseMIT
keywords monte carlo
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # sportsball

<a href="https://pypi.org/project/sportsball/">
    <img alt="PyPi" src="https://img.shields.io/pypi/v/sportsball">
</a>

A library for pulling in and normalising sports stats.

![sportsball](sportsball.png "sportsball")

## Dependencies :globe_with_meridians:

Python 3.11.6:

- [pandas](https://pandas.pydata.org/)
- [requests](https://requests.readthedocs.io/en/latest/)
- [requests-cache](https://requests-cache.readthedocs.io/en/stable/)
- [python-dateutil](https://github.com/dateutil/dateutil)
- [tqdm](https://github.com/tqdm/tqdm)

## Raison D'être :thought_balloon:

`sportsball` aims to be a library for pulling in historical information about previous sporting games in a standardised fashion for easy data processing.
The models it uses are designed to be used for many different types of sports.

The supported leagues are:

* 🏈 [NFL](https://www.nfl.com/)

## Architecture :triangular_ruler:

`sportsball` is an object orientated library. The entities are organised like so:

* **League**: The entry point to accessing data about a league.
    * **Season**: A season within a league.
        * **Game**: A game within a season.
            * **Team**: The team within the game. Note that in games with individual players a team exists as a wrapper.
                * **Player**: A player within the team.
                * **Odds**: The odds for the team to win the game.
                    * **Bookie**: The bookie publishing the odds.
            * **Venue**: The venue the game was played in.
                * **Address**: The address information of a venue.

## Caching

This library uses very aggressive caching due to the large data requirements.
The initial data load will take some time however after that it will cache the old data for up to 1 year.

## Installation :inbox_tray:

This is a python package hosted on pypi, so to install simply run the following command:

`pip install sportsball`

## Usage example :eyes:

To pull a dataframe containing all the information for a particular league, the following example can be used:

```python
import logging
import sportsball as spb

logging.basicConfig(level='DEBUG')
ball = spb.SportsBall()
league = ball.league(spb.League.NFL)
df = league.to_frame()
```

This results in a dataframe where each game is represented by all its features.

## License :memo:

The project is available under the [MIT License](LICENSE).

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/8W9aG/sportsball",
    "name": "sportsball",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "monte carlo",
    "author": "Will Sackfield",
    "author_email": "will.sackfield@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/18/5f/e32e8dea2fbdf6e09c55f61b182551128f22c01a656bc45b9477a2d743ac/sportsball-0.0.1.tar.gz",
    "platform": null,
    "description": "# sportsball\n\n<a href=\"https://pypi.org/project/sportsball/\">\n    <img alt=\"PyPi\" src=\"https://img.shields.io/pypi/v/sportsball\">\n</a>\n\nA library for pulling in and normalising sports stats.\n\n![sportsball](sportsball.png \"sportsball\")\n\n## Dependencies :globe_with_meridians:\n\nPython 3.11.6:\n\n- [pandas](https://pandas.pydata.org/)\n- [requests](https://requests.readthedocs.io/en/latest/)\n- [requests-cache](https://requests-cache.readthedocs.io/en/stable/)\n- [python-dateutil](https://github.com/dateutil/dateutil)\n- [tqdm](https://github.com/tqdm/tqdm)\n\n## Raison D'\u00eatre :thought_balloon:\n\n`sportsball` aims to be a library for pulling in historical information about previous sporting games in a standardised fashion for easy data processing.\nThe models it uses are designed to be used for many different types of sports.\n\nThe supported leagues are:\n\n* \ud83c\udfc8 [NFL](https://www.nfl.com/)\n\n## Architecture :triangular_ruler:\n\n`sportsball` is an object orientated library. The entities are organised like so:\n\n* **League**: The entry point to accessing data about a league.\n    * **Season**: A season within a league.\n        * **Game**: A game within a season.\n            * **Team**: The team within the game. Note that in games with individual players a team exists as a wrapper.\n                * **Player**: A player within the team.\n                * **Odds**: The odds for the team to win the game.\n                    * **Bookie**: The bookie publishing the odds.\n            * **Venue**: The venue the game was played in.\n                * **Address**: The address information of a venue.\n\n## Caching\n\nThis library uses very aggressive caching due to the large data requirements.\nThe initial data load will take some time however after that it will cache the old data for up to 1 year.\n\n## Installation :inbox_tray:\n\nThis is a python package hosted on pypi, so to install simply run the following command:\n\n`pip install sportsball`\n\n## Usage example :eyes:\n\nTo pull a dataframe containing all the information for a particular league, the following example can be used:\n\n```python\nimport logging\nimport sportsball as spb\n\nlogging.basicConfig(level='DEBUG')\nball = spb.SportsBall()\nleague = ball.league(spb.League.NFL)\ndf = league.to_frame()\n```\n\nThis results in a dataframe where each game is represented by all its features.\n\n## License :memo:\n\nThe project is available under the [MIT License](LICENSE).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A library for pulling in and normalising sports stats.",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/8W9aG/sportsball"
    },
    "split_keywords": [
        "monte",
        "carlo"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "185fe32e8dea2fbdf6e09c55f61b182551128f22c01a656bc45b9477a2d743ac",
                "md5": "e1ee4ea19e4f440d4b0c1822582906ac",
                "sha256": "a55020a0afc84e5af36f52824c6954c942ccbd7496d796385b0559425b8dc0e1"
            },
            "downloads": -1,
            "filename": "sportsball-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "e1ee4ea19e4f440d4b0c1822582906ac",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 11475,
            "upload_time": "2024-03-14T12:43:30",
            "upload_time_iso_8601": "2024-03-14T12:43:30.817806Z",
            "url": "https://files.pythonhosted.org/packages/18/5f/e32e8dea2fbdf6e09c55f61b182551128f22c01a656bc45b9477a2d743ac/sportsball-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-03-14 12:43:30",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "8W9aG",
    "github_project": "sportsball",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "sportsball"
}
        
Elapsed time: 0.21376s