FreeScript
ff-model
by hadantes-lab · version 2026.11.14 · updated 3 days ago
No reviews yet
- Downloads
- 0
- Reviews
- 0
- Size
- 1.5 MB
- Code check
- Clean
- Licence
- MIT
- Released
- Nov 2026
NFL fantasy draft board and player props simulator (nflverse + The Odds API)
NFL Betting Probability Model
A personal-use model that puts probabilities on player props, spreads, and
totals — then compares them to the market to flag value. Built on real nflverse
data. Includes a backtest so you can check whether it actually works.
What it is (and isn't)
Is: a real, working simulation model. Pulls live play-by-play, builds
per-player stat distributions, runs Monte Carlo, converts to probabilities,
and finds edges vs. betting lines. Backtested against historical results.
Isn't: a guaranteed money-maker. No honest model claims that. The market
is sharp. This gives you defensible probabilities and a way to VALIDATE them —
not certainty. Anyone selling certainty is lying.
The three files
File, Job
The pipeline: **projections feed the simulator; the simulator feeds edges;
the backtest proves it out.** Spreads are built by summing player projections
into team scores — the same engine does everything.
Setup (one time)
Running it
See it work immediately (no data needed): each file has a demo built in.
Run it for real (pulls live data):
This prints real projections for current players. From there, feed those
projections into
Run the tests:
How to read the output
injury news.
Shareable draft board (HTML)
A point-and-click version of
Snake mode. Mark players "Won"/"Gone" (auction) or "Draft" (snake) and
watch max bids, budget, and pick order update live. No Python needed to
use it, just a browser.
Tiers are built from current expert consensus draft rank (ADP) — FantasyPros
overall redraft rankings pulled via
onto this tool's own per-player projections by name. A new tier starts
whenever the gap to the next player exceeds the experts' own disagreement
(std. dev.) at that range. Players outside the ADP consensus land in an
"Unranked" group at the bottom, sorted by this tool's own value model.
Regenerate it after pulling fresh data:
This writes
player values baked in) you can open directly or upload anywhere to share.
Player props simulator (HTML)
Simulates every offensive player prop on this week's slate 20,000 times and
compares the result to the sportsbook lines: model probability vs. the market's
no-vig probability, best price across books, and EV per $1. Click any row for
the simulated distribution, last-10-games hit rate, and a calculator where you
can type in your book's line and price.
One-time setup (real lines need a free key from https://the-odds-api.com):
Each time you want fresh lines:
the model, with no key and no credits, just to see the layout.
Credits: listing games is free; each game costs one credit per market. The default
run (6 core markets) is at most ~90 credits for a 15-game week, and responses are
cached for 30 minutes so re-running is free.
completions, interceptions and rush+rec yards;
Whether player props are included on a free plan is up to the Odds API, not this code.
Scheduled refresh.
Monday and Thursday morning (scheduled for 6:17 AM Central, because GitHub starts scheduled runs late, sometimes by hours, so asking at 8 sharp meant a late page; a scheduled run is skipped if a refresh already succeeded in the last 12 hours, so a late start never re-spends Odds API credits) and publishes it to GitHub Pages: the draft board
at
games starting soon: **Saturday's run looks 2 days ahead, so its page is the whole Sunday slate (and Sunday night) with every game's props pulled in one go;
Monday's is Monday night's game alone, and Thursday's is Thursday night's** (gam
…
A personal-use model that puts probabilities on player props, spreads, and
totals — then compares them to the market to flag value. Built on real nflverse
data. Includes a backtest so you can check whether it actually works.
What it is (and isn't)
Is: a real, working simulation model. Pulls live play-by-play, builds
per-player stat distributions, runs Monte Carlo, converts to probabilities,
and finds edges vs. betting lines. Backtested against historical results.
Isn't: a guaranteed money-maker. No honest model claims that. The market
is sharp. This gives you defensible probabilities and a way to VALIDATE them —
not certainty. Anyone selling certainty is lying.
The three files
File, Job
projections.py, Pulls nflverse data, builds per-player mean+std for each statsimulate.py, Monte Carlo engine: props, spreads, totals, edge/EV mathbacktest.py, Walk-forward out-of-sample test with hit rate, ROI, and CLVThe pipeline: **projections feed the simulator; the simulator feeds edges;
the backtest proves it out.** Spreads are built by summing player projections
into team scores — the same engine does everything.
Setup (one time)
- Install Python 3.10+ from python.org if you don't have it.
python --version
- Install the libraries:
pip install nflreadpy numpy pandasRunning it
See it work immediately (no data needed): each file has a demo built in.
python simulate.py # prop + game simulation on sample numbers
python backtest.py # backtest summary on synthetic dataRun it for real (pulls live data):
python projections.py # first run downloads nflverse data, then cachesThis prints real projections for current players. From there, feed those
projections into
simulate.py's functions with live odds.Run the tests:
python -m unittest discover -s tests -vHow to read the output
- model_prob — your model's probability the bet hits
- implied_prob — the market's probability (from the odds, vig removed)
- edge_pts — model minus market, in percentage points. Positive = value.
- ev_per_dollar — expected profit per $1 staked
- CLV (backtest) — did you beat the closing line? The #1 sign of real skill.
- Injuries at lock time are the model's biggest blind spot. If a starter is
injury news.
- Small samples lie. The backtest shouts at you below 200 bets. Respect it.
- Beating the closing line (CLV) matters more than early results. Hit rate is
- Correlation is simplified. The game-script factor is a first-order fix, not
Shareable draft board (HTML)
A point-and-click version of
auction_engine.py, with an Auction and aSnake mode. Mark players "Won"/"Gone" (auction) or "Draft" (snake) and
watch max bids, budget, and pick order update live. No Python needed to
use it, just a browser.
Tiers are built from current expert consensus draft rank (ADP) — FantasyPros
overall redraft rankings pulled via
nflreadpy's load_ff_rankings, mergedonto this tool's own per-player projections by name. A new tier starts
whenever the gap to the next player exceeds the experts' own disagreement
(std. dev.) at that range. Players outside the ADP consensus land in an
"Unranked" group at the bottom, sorted by this tool's own value model.
Regenerate it after pulling fresh data:
python export_snapshot.py > web/snapshot.json
python web/build_page.pyThis writes
web/auction_board.html, a single self-contained file (realplayer values baked in) you can open directly or upload anywhere to share.
Player props simulator (HTML)
Simulates every offensive player prop on this week's slate 20,000 times and
compares the result to the sportsbook lines: model probability vs. the market's
no-vig probability, best price across books, and EV per $1. Click any row for
the simulated distribution, last-10-games hit rate, and a calculator where you
can type in your book's line and price.
One-time setup (real lines need a free key from https://the-odds-api.com):
**create a file named .env in this folder containing one line (it is git-ignored):**
ODDS_API_KEY=your_key_hereEach time you want fresh lines:
python export_props.py # pulls lines + simulates -> web/props_snapshot.json
python web/build_props_page.py # -> web/props.html (one self-contained file)python export_props.py --sample builds the page from demo lines made up fromthe model, with no key and no credits, just to see the layout.
Credits: listing games is free; each game costs one credit per market. The default
run (6 core markets) is at most ~90 credits for a 15-game week, and responses are
cached for 30 minutes so re-running is free.
--all-markets adds attempts,completions, interceptions and rush+rec yards;
--max-events N limits games.Whether player props are included on a free plan is up to the Odds API, not this code.
Scheduled refresh.
.github/workflows/refresh-site.yml rebuilds the site every Saturday,Monday and Thursday morning (scheduled for 6:17 AM Central, because GitHub starts scheduled runs late, sometimes by hours, so asking at 8 sharp meant a late page; a scheduled run is skipped if a refresh already succeeded in the last 12 hours, so a late start never re-spends Odds API credits) and publishes it to GitHub Pages: the draft board
at
/draft/ (always) and the props page at /props/ (when the key below exists), using onlygames starting soon: **Saturday's run looks 2 days ahead, so its page is the whole Sunday slate (and Sunday night) with every game's props pulled in one go;
Monday's is Monday night's game alone, and Thursday's is Thursday night's** (gam
…