π College football with sportsdataverse-py
Saturdays in autumn, condensed into tidy DataFrames. π In a few lines of Python you're about to pull a decade of play-by-play, full rosters, schedules, team info, plus live ESPN scoreboards, standings, polls and recruiting boards β all as clean polars frames ready to model.
CFB has no single native premium API, so our premium path is two-pronged:
- ποΈ Release loaders (
load_cfb_*) β pre-built, EPA/WPA-enriched datasets served straight from the cfbfastR-data GitHub release. Fast, reliable, no key needed. - π‘ ESPN families (
espn_cfb_*) β live scoreboards, team pages, standings, rankings, recruiting and per-play participants.
R user? Every verb here has a twin in cfbfastR. Let's kick off! π
π§° The toolboxβ
Everything returns a tidy polars DataFrame by default β pass
return_as_pandas=True for pandas, or (on the espn_cfb_* wrappers)
return_parsed=False for the raw JSON. β marks the premium path.
| Function | What it gives you | Source |
|---|---|---|
load_cfb_pbp | Full play-by-play with EPA/WPA, since 2003 | β release |
load_cfb_rosters | Season rosters (bio, position, hometown) | β release |
load_cfb_schedule | Season schedule + results + Elo | β release |
load_cfb_team_info | Team metadata: conference, colors, venue | β release |
load_cfb_betting_lines | Historical betting market lines (spread/total/ML) | β release |
espn_cfb_scoreboard | Live + recent scoreboard for a date/week | β ESPN |
espn_cfb_schedule | ESPN schedule frame for a date/week | β ESPN |
espn_cfb_teams | Every FBS/FCS team (grab team_ids) | β ESPN |
espn_cfb_team_roster | One team's roster | β ESPN |
espn_cfb_team_schedule | One team's schedule | β ESPN |
espn_cfb_standings | Conference / division standings | β ESPN |
espn_cfb_rankings | AP / Coaches / CFP polls | β ESPN |
espn_cfb_leaders | League stat leaders by category | β ESPN |
espn_cfb_recruits | Season recruiting class | β ESPN |
espn_cfb_play_participants | Per-play athletes (passer/rusher/tacklerβ¦) | β ESPN |
CFBPlayProcess | Full ESPN PBP pipeline (EPA/WPA + box) | β ESPN |
most_recent_cfb_season | The current season year helper | helper |
π Setupβ
pip install sportsdataverse
No API key required. The load_cfb_* loaders read public parquet from the
cfbfastR-data release, and the espn_cfb_* wrappers hit ESPN's public
endpoints.
import polars as pl
import sportsdataverse as sdv
from sportsdataverse.cfb import most_recent_cfb_season
SEASON = most_recent_cfb_season()
print('most recent CFB season:', SEASON)
most recent CFB season: 2025
ESPN's live endpoints are seasonal and occasionally rate-limited, so a tiny
safe() helper runs the riskier calls defensively β you get the frame when
the feed is up, and a friendly one-liner when it isn't (never a scary
traceback). The release loaders are reliable, so we call those directly. π
def safe(label, thunk):
try:
out = thunk()
print(f'β
{label}')
return out
except Exception as e: # noqa: BLE001 -- demo resilience
print(f'βοΈ {label}: unavailable right now ({type(e).__name__})')
return None
ποΈ Premium loaders: a whole season in one callβ
The load_cfb_* family is the fastest way to get clean, complete
season data. Each takes a seasons= int or list (β₯ 2003) and returns one
tidy frame. Let's start with the schedule β one row per game, with final
scores, conference flags, and pre/post-game Elo ratings baked in.
| Function | Grain | Highlights |
|---|---|---|
load_cfb_schedule | one row / game | scores, Elo, neutral-site & conference flags |
schedule = sdv.cfb.load_cfb_schedule(seasons=[2023])
print('schedule shape:', schedule.shape)
schedule.select([
'game_id', 'week', 'home_team', 'away_team',
'home_points', 'away_points', 'home_conference', 'neutral_site',
]).head()
schedule shape: (3734, 31)
shape: (5, 8)
βββββββββββββ¬βββββββ¬ββββββββββββββ¬ββββββββββββββ¬βββββββββββββ¬βββββββββββββ¬βββββββββββββ¬βββββββββββββ
β game_id β week β home_team β away_team β home_point β away_point β home_confe β neutral_si β
β --- β --- β --- β --- β s β s β rence β te β
β i32 β i32 β str β str β --- β --- β --- β --- β
β β β β β i32 β i32 β str β bool β
βββββββββββββͺβββββββͺββββββββββββββͺββββββββββββββͺβββββββββββββͺβββββββββββββͺβββββββββββββͺβββββββββββββ‘
β 401525434 β 1 β Notre Dame β Navy β 42 β 3 β FBS Indepe β true β
β β β β β β β ndents β β
β 401540199 β 1 β Mercer β North β 17 β 7 β Southern β true β
β β β β Alabama β β β β β
β 401520145 β 1 β Jacksonvill β UTEP β 17 β 14 β Conference β false β
β β β e State β β β β USA β β
β 401532392 β 1 β San Diego β Ohio β 20 β 13 β Mountain β false β
β β β State β β β β West β β
β 401540628 β 1 β UAlbany β Fordham β 34 β 13 β CAA β false β
βββββββββββββ΄βββββββ΄ββββββββββββββ΄ββββββββββββββ΄βββββββββββββ΄βββββββββββββ΄βββββββββββββ΄βββββββββββββ