Skip to main content

SlickML soccer betting screener: 12-factor model, backtesting, and PDF reports via Livescore API

Project description

build codecov downloads license pypi_version python_version slack_invite twitter_url

slick-bet logo

SlickBet โšฝ: Soccer Betting Screener by SlickML๐Ÿงž

Explore Releases ๐ŸŸฃ PyPI ๐ŸŸฃ Join our Slack ๐ŸŸฃ Tweet Us

๐Ÿง  Philosophy

SlickBet โšฝ screens soccer matches via the Livescore API, scores each fixture with a 12-factor statistical model (form, venue, xG, odds, and more), and ranks betting opportunities โ€” including safer double-chance picks.

Same SlickML spirit: prototype fast ๐ŸŽ, keep axes clear, and measure with backtests ๐Ÿ”Ž.

fixtures  ร—  model  ร—  filters  ร—  backtest  ร—  export

โœจ Features

  • ๐Ÿ“… Multi-day screening โ€” next N days of fixtures
  • ๐Ÿ“Š 12-factor model โ€” form, position, home, H2H, odds, goals, venue form, defense, momentum, match stats, xG, reliability
  • ๐ŸŽฒ Double chance โ€” 1X / X2 / 12 with confidence grades
  • ๐ŸŒ League coverage โ€” major & minor Europe, Asia, Americas
  • ๐Ÿ“ˆ Backtesting โ€” historical accuracy + API response cache
  • ๐Ÿ”ง Hyperparameter tuning โ€” search weights on cached data
  • ๐Ÿ“„ PDF / JSON export โ€” shareable reports and CLI scripting

๐Ÿ›  Installation

Install Python >=3.10,<3.14 and uv, then:

git clone https://github.com/slickml/slick-bet.git
cd slick-bet
uv sync --locked --all-extras --all-groups

Task runner is Poe the Poet (same idea as slick-tune). Install once:

uv tool install poethepoet
poe greet

โš™๏ธ Configuration

Set Livescore API credentials:

export LIVESCORE_API_KEY="your_api_key"
export LIVESCORE_API_SECRET="your_api_secret"

๐Ÿ“Œ Quick Start

# Screen all leagues for tomorrow (top 20)
poe run-all --days=1 --top=20

# Major European leagues only
poe run-major

# Backtest all leagues for 1 week
poe backtest-all-global --weeks=1
from slickbet import BettingScreener, ScreenerConfig

config = ScreenerConfig(min_probability=0.60, all_leagues=True)
screener = BettingScreener(config=config)
result = screener.screen_days(3)

for bet in result.get_top_k(10):
    best_dc, prob = bet.double_chance.best_double_chance
    print(f"{bet.match.home_team.name} vs {bet.match.away_team.name}: {best_dc} @ {prob:.1%}")

๐Ÿ“‹ Commands

Screener

Command Description
poe run-all --days N Screen ALL leagues for next N days
poe run-all-week Screen ALL leagues for next 7 days
poe run-major Major European leagues (tomorrow)
poe run-major-week Major European leagues for 7 days
poe run-pl --days N Premier League only
poe run-bundesliga --days N Bundesliga only
poe run-laliga --days N La Liga only
poe run-seriea --days N Serie A only
poe run-ligue1 --days N Ligue 1 only
poe run Screen tomorrow's games
poe run-top --top K Show top K opportunities
poe run-days --days N Screen next N days

Backtest & tune

Command Description
poe backtest-all --weeks N Major + minor European leagues
poe backtest-all-global --weeks N All leagues (EU + Asia + Americas)
poe backtest-pl --weeks N Premier League backtest
poe tune --cache-dir DIR Tune weights on cached API data

API cache (fast reruns / offline tune):

# Populate cache
slickbet backtest-all --weeks 12 --cache-dir data/api_cache

# Offline rerun
slickbet backtest-all --weeks 12 --cache-dir data/api_cache --cache-only

# Tune weights
slickbet tune --cache-dir data/api_cache --trials 20

Development

Command Description
poe check Format check + ruff + mypy
poe test Pytest with 100% coverage gate
poe build Build sdist + wheel
poe fix Auto-fix lint + format
poe clean Remove caches and build artifacts

๐Ÿ’ป CLI

slickbet                          # tomorrow
slickbet --days 5 --top 10
slickbet --major-only
slickbet --asia-only
slickbet --americas-only
slickbet --all-leagues
slickbet --league 2               # competition ID
slickbet --min-prob 0.60
slickbet --json
slickbet --pdf my_report.pdf

slickbet backtest --competition 2 --weeks 4
slickbet backtest-all --include-asia --include-americas --weeks 4
slickbet competitions --country England
slickbet tune --cache-dir data/api_cache

๐Ÿ† League IDs

Major Europe

ID League Country
1 Bundesliga Germany
2 Premier League England
3 La Liga Spain
4 Serie A Italy
5 Ligue 1 France

Minor Europe

ID League Country
68 Belgian Pro League Belgium
8 Primeira Liga Portugal
6 Super Lig Turkey
196 Eredivisie Netherlands
17 1. HNL Croatia
60 Ekstraklasa Poland
75 Premiership Scotland
9 Super League Greece

Asia

ID League Country
313 Saudi Pro League Saudi Arabia
67 Hyundai A-League Australia
28 J. League Japan

Americas

ID League Country
23 Liga Professional Argentina
24 Serie A Brazil
45 Liga MX Mexico

Use slickbet competitions --country <name> to discover more IDs.

๐Ÿง  Model

flowchart TB
  match[Match + stats / odds / form]

  subgraph factors [12 weighted factors]
    direction LR
    venue["venue_form 20.6%"]
    momentum["momentum 12.0%"]
    defense["defense 10.4%"]
    home["home 9.5%"]
    reliability["reliability 8.7%"]
    goals["goals 8.6%"]
    matchStats["match_stats 7.1%"]
    h2h["h2h 6.1%"]
    odds["odds 5.5%"]
    position["position 4.7%"]
    xg["xg 3.7%"]
    form["form 3.3%"]
  end

  composite[Weighted composite score]
  probs[Home / away win probabilities]
  drawRisk[Draw risk]
  pred[BetPrediction]
  dc["Double chance: 1X ยท X2 ยท 12"]
  grade[Confidence grade]

  match --> factors
  factors --> composite
  composite --> probs
  composite --> drawRisk
  probs --> pred
  drawRisk --> pred
  pred --> dc
  pred --> grade

Tuned 12-factor weights (BettingModel.WEIGHTS in src/slickbet/model.py):

Factor Weight Description
Venue form 20.6% Home/away specific win rates
Momentum 12.0% First-half lead + win rate + comebacks
Defense 10.4% Clean sheet rate
Home advantage 9.5% Historical home edge
Reliability 8.7% Discipline / cards
Goals 8.6% Attack/defense strength
Match stats 7.1% Possession, shots, conversion
H2H 6.1% Head-to-head
Odds 5.5% Bookmaker implied probability
Position 4.7% Table differential
xG 3.7% Expected goals differential
Form 3.3% Last 5 results

Double chance & grades

  • 1X โ€” home or draw ยท X2 โ€” away or draw ยท 12 โ€” no draw
  • ๐Ÿ”ฅ HIGH VALUE ยท โœ… GOOD BET ยท ๐Ÿ‘ DECENT ยท โš ๏ธ RISKY

Backtest snippet (Python)

from slickbet import Backtester, format_backtest_report

results = Backtester().run(competition_id="313", weeks=4)
print(format_backtest_report(results))
print(f"Excl. draws: {results.accuracy_excluding_draws:.1%}")
print(f"Best DC: {results.best_double_chance_accuracy:.1%}")

๐Ÿ“ Project structure

slick-bet/
โ”œโ”€โ”€ assets/
โ”‚   โ””โ”€โ”€ logo.png
โ”œโ”€โ”€ src/slickbet/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ”œโ”€โ”€ api.py          # Livescore client + domain models
โ”‚   โ”œโ”€โ”€ model.py        # 12-factor betting model
โ”‚   โ”œโ”€โ”€ screener.py     # Screening + formatting
โ”‚   โ”œโ”€โ”€ backtest.py     # Historical evaluation
โ”‚   โ”œโ”€โ”€ cache.py        # File-based API cache
โ”‚   โ”œโ”€โ”€ tune.py         # Weight search
โ”‚   โ”œโ”€โ”€ cli.py          # `slickbet` entrypoint
โ”‚   โ””โ”€โ”€ pdf_export.py   # ReportLab PDFs
โ”œโ”€โ”€ tests/
โ”œโ”€โ”€ .github/workflows/  # ci.yml + cd.yml only
โ”œโ”€โ”€ .coveragerc
โ”œโ”€โ”€ ruff.toml
โ”œโ”€โ”€ mypy.ini
โ”œโ”€โ”€ pytest.ini
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md

โš ๏ธ Disclaimer

For educational and entertainment purposes only.

  • Past performance does not guarantee future results
  • Sports betting involves risk of financial loss
  • Predict responsibly and within your means
  • Check local laws in your jurisdiction

โ“ Need help?

Join our Slack to talk with the SlickML team.

License

MIT โ€” see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

slickbet-0.3.0.tar.gz (178.6 kB view details)

Uploaded Source

Built Distribution

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

slickbet-0.3.0-py3-none-any.whl (68.1 kB view details)

Uploaded Python 3

File details

Details for the file slickbet-0.3.0.tar.gz.

File metadata

  • Download URL: slickbet-0.3.0.tar.gz
  • Upload date:
  • Size: 178.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for slickbet-0.3.0.tar.gz
Algorithm Hash digest
SHA256 1c99b433699d075e8833af3c03ae84052e025d07663e0f106ab05d9208e69225
MD5 8fa1a154b1eb0579d830f07f8bfb5d43
BLAKE2b-256 7c551aa0e70f721a4ff4a6a4b9b88b6e7fb0648a46e964e8eefcbe6d7d2f6f2a

See more details on using hashes here.

File details

Details for the file slickbet-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: slickbet-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 68.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for slickbet-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3dbd1354f02ddde4d3a4fb81356c4fecd08674954ac4db99767ace4ccecb2076
MD5 89ff73fca00512a9505b05cc69b3baf1
BLAKE2b-256 23c6b750ea2be171096aea54001e660e54e2e0ccbe17f075962611c18a56a754

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page