Skip to main content

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

sportsbet_eda_vanshs29362-0.1.0.tar.gz (13.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sportsbet_eda_vanshs29362-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file sportsbet_eda_vanshs29362-0.1.0.tar.gz.

File metadata

File hashes

Hashes for sportsbet_eda_vanshs29362-0.1.0.tar.gz
Algorithm Hash digest
SHA256 76ec4f1a2907c70e473060d4b87e2851fb930d40dbe536364d1dbb71f22d6d7d
MD5 220edaa2a05cbcd5e5dce059f111f379
BLAKE2b-256 8558622048197f64c51f9cc54e08e63842a79c03e408e4ac5662ff2b8bf3f99d

See more details on using hashes here.

File details

Details for the file sportsbet_eda_vanshs29362-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for sportsbet_eda_vanshs29362-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ad3962bb72b956ff374f4d9ad109194fa0aecb431ee582a18ae02e84c753bd62
MD5 39cada63ef9fa335ecb62fb49babedb3
BLAKE2b-256 5913322473dd55da15c806060b95e9ed4cd24e4a34848a46a70ebcbb3b195cb9

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page