Metadata-Version: 2.4
Name: sportsbet-eda-vanshs29362
Version: 0.1.0
Summary: Tiny EDA and seaborn visualisation helpers for sports-betting data
Author-email: Vansh Saxena <vsaxena3@dons.usfca.edu>
License: MIT License
        
        Copyright (c) 2026 Vansh Saxena
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/VanshS29362/Pylib
Project-URL: Repository, https://github.com/VanshS29362/Pylib
Project-URL: Issues, https://github.com/VanshS29362/Pylib/issues
Keywords: sports betting,eda,seaborn,pandas,odds,visualization
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Scientific/Engineering :: Visualization
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pandas>=1.5
Requires-Dist: seaborn>=0.12
Requires-Dist: matplotlib>=3.5
Requires-Dist: numpy>=1.21
Provides-Extra: test
Requires-Dist: pytest>=7; extra == "test"
Dynamic: license-file

# sportsbet-eda-vanshs29362

Tiny **exploratory-data-analysis** and **seaborn visualisation** helpers for
sports-betting data. Point it at a log of bets (or the built-in sample) and get
back plain summaries, betting metrics, and clean seaborn charts.

- **Install name:** `sportsbet-eda-vanshs29362` (used by pip / PyPI)
- **Import name:** `sportsbet_eda` (used in Python)

## Install

```bash
pip install sportsbet-eda-vanshs29362
```

## Quickstart

```python
import sportsbet_eda as sb

# Use your own bet log, or start with the built-in synthetic one:
df = sb.sample_bets(200)

# --- EDA -----------------------------------------------------------------
sb.summarize(df)          # {'rows': 200, 'columns': 9, 'names': [...], 'dtypes': {...}}
sb.missing(df)            # missing values per column (pandas Series)
sb.numeric_columns(df)    # ['odds', 'stake', 'profit']

# --- Betting metrics -----------------------------------------------------
sb.bet_summary(df)        # {'bets': 200, 'wins': ..., 'win_rate': ..., 'roi': ...}
sb.win_rate(df)           # fraction of decided bets that won
sb.roi(df)                # total profit / total staked

# --- Odds math (scalars or pandas Series) --------------------------------
sb.implied_probability(2.50)                   # 0.40
sb.implied_probability(-150, kind="american")  # 0.60
sb.american_to_decimal(150)                    # 2.5
sb.no_vig_probability([1.91, 1.91])            # [0.5, 0.5]  (margin removed)
sb.bookmaker_margin([1.91, 1.91])              # 0.0471      (the "vig")
```

## Charts (seaborn)

Every plot returns a matplotlib `Axes`, so you can show or save it:

```python
import matplotlib.pyplot as plt
import sportsbet_eda as sb

df = sb.sample_bets()
sb.set_theme()                              # optional clean seaborn theme

sb.plot_cumulative_profit(df)               # bankroll curve over time
sb.plot_profit_by(df, by="sport")           # total profit per sport
sb.plot_win_rate_by(df, by="market")        # win rate per market
sb.plot_odds_distribution(df)               # histogram of odds
sb.plot_correlation(df)                     # heatmap of numeric columns

plt.show()                                  # or ax.figure.savefig("out.png")
```

## Expected data

The betting functions work on a tidy "one row per settled bet" table. The
sample frame uses these columns, and you can point the functions at your own
column names with the keyword arguments:

| column      | meaning                              | used by |
|-------------|--------------------------------------|---------|
| `odds`      | decimal odds of the bet              | odds / distribution plots |
| `stake`     | amount risked                        | `roi`, `bet_summary` |
| `result`    | `win` / `loss` / `push` (flexible)   | `win_rate`, `bet_summary` |
| `profit`    | net profit of the bet                | `roi`, profit plots |
| `sport`, `market`, `bookmaker`, `date` | categories / timeline | grouped plots |

`result` matching is forgiving: `win/won/w/1/true/yes` count as wins and
`push/void/tie/draw` are excluded from the win rate; everything else is a loss.

## Develop

```bash
python -m pip install -e ".[test]"   # editable install with test deps
pytest                               # run the tests
python -m build                      # build wheel + sdist into dist/
python -m twine check dist/*         # validate the artifacts
```

## License

MIT — see [LICENSE](LICENSE).
