Python client for the StatHead fantasy football model — rookie career predictions, historical ADP, and flattened feature matrices.
Project description
stathead
Python client for the StatHead fantasy football model. Returns pandas DataFrames of rookie career predictions, historical ADP, and the flattened feature matrix used to train the models.
Install
pip install stathead
Optional extras:
pip install "stathead[polars]" # for .to_polars() helpers
pip install "stathead[duckdb]" # for local SQL querying
Quick start
import stathead as sh
# 2026 rookie class predictions (77 players × ~80 columns)
rookies = sh.load_career_predictions_2026()
rookies.nlargest(10, "percentile")[["name", "position", "predictedCareerPPG", "modelTier"]]
# Historical backtest — predicted vs actual for every drafted rookie 2010-2025
backtest = sh.load_career_backtest()
wr = backtest[backtest.position == "WR"]
wr.groupby("modelTier")[["actualPPG", "predictedPPG"]].mean()
# Historical ADP, every season fully populated
adp = sh.load_adp_historical()
adp[(adp.season == 2023) & (adp.adp <= 24)]
Pinning to a specific version
Loaders resolve against the upstream GitHub repo. Pin to a commit SHA, tag, or branch for reproducibility:
sh.pin_version("a6720e5") # or a tagged release
Clear the local cache if you want to re-fetch:
sh.clear_cache()
Data freshness
Data files are cached under ~/.cache/stathead/<ref>/ after the first
download. Subsequent runs read from disk — no network roundtrip. Delete the
cache directory or call clear_cache() to force a refresh.
Available loaders
| Function | Returns | Shape |
|---|---|---|
load_career_predictions_2026() |
2026 rookie predictions | ~77 × ~80 cols |
load_career_backtest() |
Historical rookies with pred + actual PPG | ~1087 × ~100 cols |
load_adp_historical() |
Model-training ADP 2010-2025 | 4507 × 10 |
load_adp_ffc(season=None) |
FFC PPR raw ADP (per season as fetched) — data via Fantasy Football Calculator | variable |
load_prospect_grades(year=2026) |
Scouting-report grades | ~200 × 7 |
load_feature_matrix() |
Raw feature-matrix.json (dict) |
— |
load_manual_overrides() |
Manual CFBD usage overrides (dict) | — |
Feature columns
Career-prediction and backtest rows include flattened model features
under names like collegeDominatorRating, relativeAthleticScore,
recruitRating, nflDraftPick, plus two source-agnostic families
aggregated from the project's scouting-report pipeline:
scout*— single-scout grade signals (e.g.scoutGradeDraft,scoutTierOrdinal,scoutBreadthDraft,scoutNComps).guide*— multi-source draft-guide aggregations (guideRankMean,guideRankSpread,guideNStrengths,guideNWeaknesses,guideSentimentNet, …).
Both families are derived numeric features (counts, means, ordinals) —
no verbatim scouting-report text is shipped. hasScoutGrade /
hasGuideData flag missing-data so models can distinguish
"no scout coverage" from "low score".
Licensing & attribution
Package code is MIT-licensed. The data this package retrieves is derived from the StatHead project's own modeling pipeline; upstream sources (nflverse, FFC, CFBD, etc.) retain their own terms — see each source's license before redistributing. Sources whose terms do not permit third-party redistribution (e.g. KeepTradeCut dynasty values, verbatim prose from paid scouting reports) are intentionally not exposed by this client.
ADP data exposed by load_adp_ffc is courtesy of
Fantasy Football Calculator — please
preserve attribution when redistributing.
If you're building on these predictions, a link back to the StatHead repo is appreciated but not required.
Contributing
The package is small and focused — see
python/src/stathead/ for the loader modules. Issues
and PRs welcome at the main repo.
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
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 stathead-0.2.1.tar.gz.
File metadata
- Download URL: stathead-0.2.1.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e0b2a352961d3445f665a9e59adad862a8cab11769acead04aef8213121fb64
|
|
| MD5 |
2077f706e608ce61ba0337d4210b1ce7
|
|
| BLAKE2b-256 |
548af4a302154d1e49381b2996cb5ab4d1ac66ec9e75b448decb1b8af91b5bf7
|
Provenance
The following attestation bundles were made for stathead-0.2.1.tar.gz:
Publisher:
python-publish.yml on dachhack/stathead
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stathead-0.2.1.tar.gz -
Subject digest:
3e0b2a352961d3445f665a9e59adad862a8cab11769acead04aef8213121fb64 - Sigstore transparency entry: 1739884242
- Sigstore integration time:
-
Permalink:
dachhack/stathead@229c46c30403917aa38db00472a887e5035ae43b -
Branch / Tag:
refs/heads/claude/nfl-fantasy-workbench-6D1yd - Owner: https://github.com/dachhack
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@229c46c30403917aa38db00472a887e5035ae43b -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file stathead-0.2.1-py3-none-any.whl.
File metadata
- Download URL: stathead-0.2.1-py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27c161beb9e3de63850f76c3e8712f923e263e3e7f744fd4234a6af0e00a606b
|
|
| MD5 |
b15ee8ec53e5fc128b00dfbd7aa28f13
|
|
| BLAKE2b-256 |
336aab64c84fe92feffa6a6de6dfa3681b87b3185d12151ce23ea3cb162f5a18
|
Provenance
The following attestation bundles were made for stathead-0.2.1-py3-none-any.whl:
Publisher:
python-publish.yml on dachhack/stathead
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stathead-0.2.1-py3-none-any.whl -
Subject digest:
27c161beb9e3de63850f76c3e8712f923e263e3e7f744fd4234a6af0e00a606b - Sigstore transparency entry: 1739884249
- Sigstore integration time:
-
Permalink:
dachhack/stathead@229c46c30403917aa38db00472a887e5035ae43b -
Branch / Tag:
refs/heads/claude/nfl-fantasy-workbench-6D1yd - Owner: https://github.com/dachhack
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@229c46c30403917aa38db00472a887e5035ae43b -
Trigger Event:
workflow_dispatch
-
Statement type: