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
pip install sportsbet-eda-vanshs29362
Quickstart
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:
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
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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sportsbet_eda_vanshs29362-0.1.0.tar.gz.
File metadata
- Download URL: sportsbet_eda_vanshs29362-0.1.0.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76ec4f1a2907c70e473060d4b87e2851fb930d40dbe536364d1dbb71f22d6d7d
|
|
| MD5 |
220edaa2a05cbcd5e5dce059f111f379
|
|
| BLAKE2b-256 |
8558622048197f64c51f9cc54e08e63842a79c03e408e4ac5662ff2b8bf3f99d
|
File details
Details for the file sportsbet_eda_vanshs29362-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sportsbet_eda_vanshs29362-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.13.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad3962bb72b956ff374f4d9ad109194fa0aecb431ee582a18ae02e84c753bd62
|
|
| MD5 |
39cada63ef9fa335ecb62fb49babedb3
|
|
| BLAKE2b-256 |
5913322473dd55da15c806060b95e9ed4cd24e4a34848a46a70ebcbb3b195cb9
|