SlickML soccer betting screener: 12-factor model, backtesting, and PDF reports via Livescore API
Project description
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
Release history Release notifications | RSS feed
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1c99b433699d075e8833af3c03ae84052e025d07663e0f106ab05d9208e69225
|
|
| MD5 |
8fa1a154b1eb0579d830f07f8bfb5d43
|
|
| BLAKE2b-256 |
7c551aa0e70f721a4ff4a6a4b9b88b6e7fb0648a46e964e8eefcbe6d7d2f6f2a
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3dbd1354f02ddde4d3a4fb81356c4fecd08674954ac4db99767ace4ccecb2076
|
|
| MD5 |
89ff73fca00512a9505b05cc69b3baf1
|
|
| BLAKE2b-256 |
23c6b750ea2be171096aea54001e660e54e2e0ccbe17f075962611c18a56a754
|