moneyball


Namemoneyball JSON
Version 0.0.6 PyPI version JSON
download
home_pagehttps://github.com/8W9aG/moneyball
SummaryA library for determining what bets to make.
upload_time2025-01-23 23:13:29
maintainerNone
docs_urlNone
authorWill Sackfield
requires_pythonNone
licenseMIT
keywords sports betting
VCS
bugtrack_url
requirements pandas empyrical numpy optuna pytz python-dateutil scikit-learn sportsball feature-engine tqdm openskill pandarallel torch catboost scipy joblib venn-abers matplotlib pyfolio-reloaded fullmonte skfolio
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # moneyball

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

A library for determining what bets to make.

<p align="center">
    <img src="moneyball.png" alt="moneyball" width="200"/>
</p>

## Dependencies :globe_with_meridians:

Python 3.11.6:

- [pandas](https://pandas.pydata.org/)
- [empyrical](https://github.com/quantopian/empyrical)
- [numpy](https://numpy.org/)
- [optuna](https://optuna.readthedocs.io/en/stable/)
- [pytz](https://pythonhosted.org/pytz/)
- [python-dateutil](https://github.com/dateutil/dateutil)
- [scikit-learn](https://scikit-learn.org/)
- [sportsball](https://github.com/8W9aG/sportsball)
- [feature-engine](https://feature-engine.trainindata.com/en/latest/)
- [tqdm](https://github.com/tqdm/tqdm)
- [openskill](https://openskill.me/en/latest/index.html)
- [pandarallel](https://nalepae.github.io/pandarallel/)
- [pytorch](https://pytorch.org/)
- [catboost](https://catboost.ai/)
- [scipy](https://scipy.org/)
- [joblib](https://joblib.readthedocs.io/en/stable/)
- [venn-abers](https://github.com/ip200/venn-abers)
- [matplotlib](https://matplotlib.org/)
- [pyfolio-reloaded](https://github.com/stefan-jansen/pyfolio-reloaded)
- [fullmonte](https://github.com/8W9aG/fullmonte)
- [skfolio](https://skfolio.org/)

## Raison D'ĂȘtre :thought_balloon:

`moneyball` was split out of the library [sportsball](https://github.com/8W9aG/sportsball) in order to iterate separately on the quantitative strategies and the data powering them. It aims to be an automated way to come up with an optimal betting strategy when supplied with data in a `sportsball` format.

## Architecture :triangular_ruler:

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

* **Portfolio**: A collection of strategies.
    * **Strategy**: A method to determine what specific bet to make according.
        * **Features**: The features extracted from the data.
        * **Reducers**: The features removed from the data.
        * **Trainers**: The type of models used for training on the data.
        * **Weights**: Weight strategies to apply to the data.

## Installation :inbox_tray:

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

`pip install moneyball`

## Usage example :eyes:

There are many different ways of using moneyball, but we generally recommend the CLI. This pairs very well with the sister project [sportsball](https://github.com/8W9aG/sportsball).

### CLI

The following operations can be run on the CLI:

#### Train

To train a new strategy:

```
sportsball --league=nfl - | moneyball test_nfl_strategy train
```

#### Portfolio

To develop a portfolio of strategies:

```
moneyball --strategy=test_nfl_strategy --strategy=test_afl_strategy test_portfolio portfolio
```

#### Next

To get a quantitative report on the next bets to place:

```
moneyball test_portfolio next
```

This will result in the following JSON written to stdout:

```json
{
    "bets": [{
        "strategy": "test_nfl_strategy",
        "league": "nfl",
        "kelly": 0.32,
        "weight": 0.1,
        "probability": 0.95,
        "teams": [{
            "name": "giants",
            "probability": 0.1
        }, {
            "name": "dolphins",
            "probability": 0.9
        }],
        "dt": "2025-01-23T16:03:46Z"
    }]
}
```

### Python

To create a portfolio, the following example can be used:

```python
from moneyball import moneyball as mnb

df = ... # Fetch the dataframe from sportsball

moneyball = mnb.Moneyball()
strategy = moneyball.create_strategy(df, "test_strategy")
strategy.fit()
portfolio = ball.create_portfolio([strategy], "test_portfolio")
returns = portfolio.fit()
portfolio.render(returns)
```

## License :memo:

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/8W9aG/moneyball",
    "name": "moneyball",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "sports betting",
    "author": "Will Sackfield",
    "author_email": "will.sackfield@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/dd/e5/8f1e1a8f2afb5171ac18e1babbb2d319e8d4ed3501eb756966cd9133d363/moneyball-0.0.6.tar.gz",
    "platform": null,
    "description": "# moneyball\n\n<a href=\"https://pypi.org/project/moneyball/\">\n    <img alt=\"PyPi\" src=\"https://img.shields.io/pypi/v/moneyball\">\n</a>\n\nA library for determining what bets to make.\n\n<p align=\"center\">\n    <img src=\"moneyball.png\" alt=\"moneyball\" width=\"200\"/>\n</p>\n\n## Dependencies :globe_with_meridians:\n\nPython 3.11.6:\n\n- [pandas](https://pandas.pydata.org/)\n- [empyrical](https://github.com/quantopian/empyrical)\n- [numpy](https://numpy.org/)\n- [optuna](https://optuna.readthedocs.io/en/stable/)\n- [pytz](https://pythonhosted.org/pytz/)\n- [python-dateutil](https://github.com/dateutil/dateutil)\n- [scikit-learn](https://scikit-learn.org/)\n- [sportsball](https://github.com/8W9aG/sportsball)\n- [feature-engine](https://feature-engine.trainindata.com/en/latest/)\n- [tqdm](https://github.com/tqdm/tqdm)\n- [openskill](https://openskill.me/en/latest/index.html)\n- [pandarallel](https://nalepae.github.io/pandarallel/)\n- [pytorch](https://pytorch.org/)\n- [catboost](https://catboost.ai/)\n- [scipy](https://scipy.org/)\n- [joblib](https://joblib.readthedocs.io/en/stable/)\n- [venn-abers](https://github.com/ip200/venn-abers)\n- [matplotlib](https://matplotlib.org/)\n- [pyfolio-reloaded](https://github.com/stefan-jansen/pyfolio-reloaded)\n- [fullmonte](https://github.com/8W9aG/fullmonte)\n- [skfolio](https://skfolio.org/)\n\n## Raison D'\u00eatre :thought_balloon:\n\n`moneyball` was split out of the library [sportsball](https://github.com/8W9aG/sportsball) in order to iterate separately on the quantitative strategies and the data powering them. It aims to be an automated way to come up with an optimal betting strategy when supplied with data in a `sportsball` format.\n\n## Architecture :triangular_ruler:\n\n`moneyball` is an object orientated library. The entities are organised like so:\n\n* **Portfolio**: A collection of strategies.\n    * **Strategy**: A method to determine what specific bet to make according.\n        * **Features**: The features extracted from the data.\n        * **Reducers**: The features removed from the data.\n        * **Trainers**: The type of models used for training on the data.\n        * **Weights**: Weight strategies to apply to the data.\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 moneyball`\n\n## Usage example :eyes:\n\nThere are many different ways of using moneyball, but we generally recommend the CLI. This pairs very well with the sister project [sportsball](https://github.com/8W9aG/sportsball).\n\n### CLI\n\nThe following operations can be run on the CLI:\n\n#### Train\n\nTo train a new strategy:\n\n```\nsportsball --league=nfl - | moneyball test_nfl_strategy train\n```\n\n#### Portfolio\n\nTo develop a portfolio of strategies:\n\n```\nmoneyball --strategy=test_nfl_strategy --strategy=test_afl_strategy test_portfolio portfolio\n```\n\n#### Next\n\nTo get a quantitative report on the next bets to place:\n\n```\nmoneyball test_portfolio next\n```\n\nThis will result in the following JSON written to stdout:\n\n```json\n{\n    \"bets\": [{\n        \"strategy\": \"test_nfl_strategy\",\n        \"league\": \"nfl\",\n        \"kelly\": 0.32,\n        \"weight\": 0.1,\n        \"probability\": 0.95,\n        \"teams\": [{\n            \"name\": \"giants\",\n            \"probability\": 0.1\n        }, {\n            \"name\": \"dolphins\",\n            \"probability\": 0.9\n        }],\n        \"dt\": \"2025-01-23T16:03:46Z\"\n    }]\n}\n```\n\n### Python\n\nTo create a portfolio, the following example can be used:\n\n```python\nfrom moneyball import moneyball as mnb\n\ndf = ... # Fetch the dataframe from sportsball\n\nmoneyball = mnb.Moneyball()\nstrategy = moneyball.create_strategy(df, \"test_strategy\")\nstrategy.fit()\nportfolio = ball.create_portfolio([strategy], \"test_portfolio\")\nreturns = portfolio.fit()\nportfolio.render(returns)\n```\n\n## License :memo:\n\nThe project is available under the [MIT License](LICENSE).\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A library for determining what bets to make.",
    "version": "0.0.6",
    "project_urls": {
        "Homepage": "https://github.com/8W9aG/moneyball"
    },
    "split_keywords": [
        "sports",
        "betting"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dde58f1e1a8f2afb5171ac18e1babbb2d319e8d4ed3501eb756966cd9133d363",
                "md5": "17445f1236b68ffa1466f6c4abf42e67",
                "sha256": "a6a2683b352090dd30cc8a0f34aa4d4963518eece04b243ba66df0d126c00106"
            },
            "downloads": -1,
            "filename": "moneyball-0.0.6.tar.gz",
            "has_sig": false,
            "md5_digest": "17445f1236b68ffa1466f6c4abf42e67",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 28972,
            "upload_time": "2025-01-23T23:13:29",
            "upload_time_iso_8601": "2025-01-23T23:13:29.118994Z",
            "url": "https://files.pythonhosted.org/packages/dd/e5/8f1e1a8f2afb5171ac18e1babbb2d319e8d4ed3501eb756966cd9133d363/moneyball-0.0.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-23 23:13:29",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "8W9aG",
    "github_project": "moneyball",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [
        {
            "name": "pandas",
            "specs": [
                [
                    ">=",
                    "2.2.3"
                ]
            ]
        },
        {
            "name": "empyrical",
            "specs": [
                [
                    ">=",
                    "0.5.5"
                ]
            ]
        },
        {
            "name": "numpy",
            "specs": [
                [
                    ">=",
                    "1.26.4"
                ]
            ]
        },
        {
            "name": "optuna",
            "specs": [
                [
                    ">=",
                    "4.2.0"
                ]
            ]
        },
        {
            "name": "pytz",
            "specs": [
                [
                    ">=",
                    "2024.2"
                ]
            ]
        },
        {
            "name": "python-dateutil",
            "specs": [
                [
                    ">=",
                    "2.9.0.post0"
                ]
            ]
        },
        {
            "name": "scikit-learn",
            "specs": [
                [
                    ">=",
                    "1.6.1"
                ]
            ]
        },
        {
            "name": "sportsball",
            "specs": [
                [
                    ">=",
                    "0.3.6"
                ]
            ]
        },
        {
            "name": "feature-engine",
            "specs": [
                [
                    ">=",
                    "1.8.3"
                ]
            ]
        },
        {
            "name": "tqdm",
            "specs": [
                [
                    ">=",
                    "4.67.1"
                ]
            ]
        },
        {
            "name": "openskill",
            "specs": [
                [
                    ">=",
                    "6.0.2"
                ]
            ]
        },
        {
            "name": "pandarallel",
            "specs": [
                [
                    ">=",
                    "1.6.5"
                ]
            ]
        },
        {
            "name": "torch",
            "specs": [
                [
                    ">=",
                    "2.5.1"
                ]
            ]
        },
        {
            "name": "catboost",
            "specs": [
                [
                    ">=",
                    "1.2.7"
                ]
            ]
        },
        {
            "name": "scipy",
            "specs": [
                [
                    ">=",
                    "1.15.1"
                ]
            ]
        },
        {
            "name": "joblib",
            "specs": [
                [
                    ">=",
                    "1.4.2"
                ]
            ]
        },
        {
            "name": "venn-abers",
            "specs": [
                [
                    ">=",
                    "1.4.6"
                ]
            ]
        },
        {
            "name": "matplotlib",
            "specs": [
                [
                    ">=",
                    "3.10.0"
                ]
            ]
        },
        {
            "name": "pyfolio-reloaded",
            "specs": [
                [
                    ">=",
                    "0.9.8"
                ]
            ]
        },
        {
            "name": "fullmonte",
            "specs": [
                [
                    ">=",
                    "0.0.4"
                ]
            ]
        },
        {
            "name": "skfolio",
            "specs": [
                [
                    ">=",
                    "0.7.0"
                ]
            ]
        }
    ],
    "lcname": "moneyball"
}
        
Elapsed time: 0.77171s