Skip to main content
Version: 0.2.0

College football — additional Python functions — Highlights

CFBPlayProcess​

CFBPlayProcess(gameId=0, raw=False, path_to_json='/', return_keys=None, odds_override=None, game_roster=None, participants=None, join_participants=True, resolve_missing=True, **kwargs)

Process ESPN college-football play-by-play feeds into a tidy game-level dictionary.

Wraps the ESPN playbyplay / summary endpoints (or a local JSON dump) and pipes the result through a chain of feature-engineering steps -- down/distance, play-type flags, EPA, WPA, QBR, drive aggregation, and an advanced box score. Use run_processing_pipeline() for the full feature set or run_cleaning_pipeline() for a lighter clean.

Parameters

ParameterTypeDefaultDescription
gameId0ESPN game id.
rawFalseif True, espn_cfb_pbp() returns the (allowlisted) summary verbatim.
path_to_json'/'directory for cfb_pbp_disk() offline loads.
return_keysNoneoptional subset of result keys to return.
odds_overrideNoneoptional dict {gameSpread, overUnder, homeFavorite, gameSpreadAvailable} that short-circuits odds resolution (sets odds_source="injected") so offline rebuilds never hit the live core-odds endpoint or fall back to defaults. Validated + coerced here. An optional overUnderAvailable key says whether overUnder is a market total (True/False, "true"/"false"/"1"/"0", or None; anything else raises ValueError). A missing key means UNKNOWN: the payload value and the play column are null, never a guess, because a producer that filled 55.5 itself cannot say so without the key. EPA / WP are unchanged by the flag. External overrides should carry it; a rebuild of a game whose total was defaulted passes overUnderAvailable=False and warns.
game_rosterNoneoptional pre-fetched game roster (the list of athlete records from ~sportsdataverse.cfb.cfb_game_rosters.espn_cfb_game_rosters, or the {"data": [...]} wrapper). Used by __attach_player_ids to resolve a roster-backed {type}_player_id for each extracted {type}_player_name on games that lack a structured participants[] array (pre-2014), and by the usage box for positions and tacklers' teams. Passing it makes offline rebuilds fetch-free; when omitted the live path reads the two team-roster pages (three requests for a current game, not one per athlete; an older game's unnamed entries fetch only those athletes) and keeps the result here.
participantsNone
join_participantsTruewhen True (default) the pipeline coalesces ESPN per-play participant names over the regex-extracted names and resolves a roster-backed {type}_player_id -- both of which hit the network (the participants/playbyplay endpoints and the game roster). Set False (CFBPlayProcess(..., join_participants=False)) to skip those lookups for a ~20x faster, network-free run. EPA / WPA / CPOE are unaffected (the models key on game state, not player identity); the cost is that {type}_player_id columns go null and names fall back to regex-from-text instead of clean ESPN displays.
resolve_missingTruepassed to ~sportsdataverse.cfb.cfb_play_participants.espn_cfb_play_participants when the pipeline fetches participants. True (default) fetches each athlete the participants sidecar omits (up to 50 requests); False keeps the fetch to the sidecar, for a caller serving requests.

Example

from sportsdataverse.cfb import CFBPlayProcess
proc = CFBPlayProcess(gameId=401628334)
proc.espn_cfb_pbp()
result = proc.run_processing_pipeline()
len(result["plays"])

# Offline replay from a JSON dump

proc = CFBPlayProcess(gameId=401628334, path_to_json="./pbp_dump")
proc.cfb_pbp_disk()
result = proc.run_processing_pipeline()

Methods

CFBPlayProcess.add_2pt_probs​

CFBPlayProcess.add_2pt_probs()

Add the cfb4th two-point-conversion decision surface to the processed plays.

Runs run_processing_pipeline first if it hasn't already, then computes the extra-point vs go-for-2 win-probability options on every point-after / two-point conversion row via sportsdataverse.cfb.cfb_two_point.get_2pt_probs. A row is treated as a PAT / two-point attempt when pointAfterAttempt.text is present (or the derived extra_point_result / two_point_conv_result is non-null). The new columns -- two_pt_wp, xp_wp, prob_2pt, two_pt_recommendation ("go_for_2" / "kick_xp") and two_pt_wp_diff (two_pt_wp - xp_wp, positive => go for 2) -- are written back onto self.plays_json (and self.json's plays); every other row carries nulls.

Returns

self.plays_json as a frame with the decision columns appended (also persisted back onto the instance).

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
game.run_processing_pipeline()
out = game.add_2pt_probs()
print(out.filter(pl.col("two_pt_recommendation").is_not_null())
.select(["two_pt_wp", "xp_wp", "two_pt_recommendation"])
.head())

CFBPlayProcess.add_fourth_down_probs​

CFBPlayProcess.add_fourth_down_probs()

Add the cfb4th 4th-down decision surface to the processed plays.

Runs run_processing_pipeline first if it hasn't already, then computes the go / punt / field-goal win-probability options plus the max-WP fourth_down_recommendation (and per-option *_wp_diff and go_boost) on every 4th-down row via sportsdataverse.cfb.cfb_fourth_down.get_4th_down_probs. The new columns are written back onto self.plays_json (and self.json's plays); non-4th-down rows carry nulls for the decision columns.

Field-goal columns (fg_make_prob / make_fg_wp / miss_fg_wp / fg_wp) are null when the cfb4th FG model isn't bundled (cfb_fourth_down.FG_MODEL_AVAILABLE is False) -- the go + punt surface and the recommendation over the available options are still computed.

Returns

self.plays_json as a frame with the decision columns appended (also persisted back onto the instance).

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
game.run_processing_pipeline()
fourth = game.add_fourth_down_probs()
print(fourth.filter(pl.col("start.down") == 4)
.select(["go_wp", "punt_wp", "fg_wp", "fourth_down_recommendation"])
.head())

CFBPlayProcess.cfb_pbp_disk​

CFBPlayProcess.cfb_pbp_disk()

Load a previously cached ESPN summary JSON for this game from disk.

Reads {path_to_json}/{gameId}.json where path_to_json was passed to the CFBPlayProcess constructor.

Reading from disk does not make the pipeline offline: with the defaults, run_processing_pipeline() still requests ESPN participants for every play, and a summary with fewer than two pickcenter providers still requests ESPN's odds endpoint. For a rebuild that makes no request, pass join_participants=False and the persisted odds_override to the constructor, or hand the file to espn_cfb_pbp(summary=...), which sets both.

Returns

Parsed JSON contents, also stored on self.json.

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334, path_to_json="./cache")
pbp = game.cfb_pbp_disk()
print(list(pbp.keys()))

# Offline rebuild (no network)

odds = {"gameSpread": -4.0, "overUnder": 58.5, "homeFavorite": True, "gameSpreadAvailable": True}
game = CFBPlayProcess(gameId=401628334, path_to_json="./cache", join_participants=False,
odds_override=odds)
game.cfb_pbp_disk()
out = game.run_processing_pipeline()

CFBPlayProcess.cfb_pbp_json​

CFBPlayProcess.cfb_pbp_json(**kwargs)

Return the JSON payload currently attached to this CFBPlayProcess

instance.

Returns

The cached JSON payload (self.json).

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
cached = game.cfb_pbp_json()

CFBPlayProcess.corrupt_pbp_check​

CFBPlayProcess.corrupt_pbp_check()

Heuristic check for corrupt or incomplete play-by-play.

Flags games with zero plays, fewer than 50 plays for a completed game, or more than 500 plays for a completed game -- all of which historically indicate ESPN delivered a malformed PBP payload that should not be processed downstream.

Returns

True if PBP looks corrupt and the processing pipeline should be skipped, False otherwise.

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
if not game.corrupt_pbp_check():
game.run_processing_pipeline()

CFBPlayProcess.create_box_score​

CFBPlayProcess.create_box_score(play_df)

Build a per-team and per-player advanced box score from a processed

plays frame.

Triggers run_processing_pipeline first if it hasn't already run, so the input play_df is expected to be the post-pipeline plays frame.

Parameters

ParameterTypeDefaultDescription
play_dfpl.DataFrameThe plays frame produced by run_processing_pipeline (with EPA, WPA and play-type flags already populated).

Returns

Box-score sections, each a list of records — "pass" / "rush" / "receiver" (per-player advanced + EPA lines; the pass and receiver lines carry AirYds / aDOT / CompAirYds / YAC / AirYdsPct, null when ESPN's text has no catch spot), "team" and "situational" (per-team), "defensive" and "defensive_players" (team- and player-level havoc), "specialists" (kicking / punting / return players), "turnover", "drives", and the ESPN-sourced "espn_team" / "espn_players" totals.

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
processed = game.run_processing_pipeline()
box = game.create_box_score(game.plays_json)
print(list(box.keys()))

CFBPlayProcess.create_drive_summary​

CFBPlayProcess.create_drive_summary(play_df, drives, periods=None) -> 'dict | None'

Build the StatBroadcast-style drive summary for this game.

Thin delegate to sportsdataverse.cfb.cfb_drive_summary.create_drive_summary, with the team ids read from the plays frame -- the drive-level sibling of create_box_score.

Parameters

ParameterTypeDefaultDescription
play_dfpl.DataFramethe post-pipeline plays frame (plays_frame).
driveslist[dict]the ESPN drives grouping in game order.
periodsNoneoptional window (a set of quarter numbers, or "ot").

Returns

the drive summary, or None when inputs are unusable.

CFBPlayProcess.create_situational_stats​

CFBPlayProcess.create_situational_stats(play_df, window_expr=None) -> 'dict | None'

Build the situational team-stats block for this game.

Thin delegate to sportsdataverse.cfb.cfb_situational_stats.create_situational_stats, with the team ids read from the plays frame.

Parameters

ParameterTypeDefaultDescription
play_dfpl.DataFramethe post-pipeline plays frame (plays_frame).
window_exprNoneoptional polars filter windowing the windowable sections (e.g. pl.col("period") == 3).

Returns

the situational stats, or None when the frame is unusable or the window is empty.

CFBPlayProcess.espn_cfb_pbp​

CFBPlayProcess.espn_cfb_pbp(summary=None, **kwargs)

espn_cfb_pbp() - Pull the game by id. Data from API endpoints: college-football/playbyplay,

college-football/summary

Parameters

ParameterTypeDefaultDescription
summarydict, optionalNoneA previously fetched ESPN summary payload. When given, no request is made -- the offline path for committed raw libraries -- and the pipeline joins participants only if participants= was passed at construction (it never fetches them, nor a roster, for a supplied summary).

Returns

Dictionary of game data with keys - "gameId", "plays", "boxscore", "header", "broadcasts", "videos", "playByPlaySource", "standings", "leaders", "timeouts", "homeTeamSpread", "overUnder", "pickcenter", "againstTheSpread", "odds", "predictor", "winprobability", "espnWP", "gameInfo", "season"

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
pbp = game.espn_cfb_pbp()
print(list(pbp.keys()))

# Pull only the raw ESPN summary payload (skip cleaning)

raw_pbp = CFBPlayProcess(gameId=401628334, raw=True).espn_cfb_pbp()

# Pipeline next step (run the full processing pipeline for advanced features)

game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
processed = game.run_processing_pipeline() # adds EPA, WPA, box score

CFBPlayProcess.run_cleaning_pipeline​

CFBPlayProcess.run_cleaning_pipeline()

Run the lighter cleaning pipeline (no EPA/WPA/QBR/box-score).

Same per-play feature engineering as run_processing_pipeline through __add_spread_time, but stops short of the modeling steps. Use this when you only need cleaned plays and don't need expected points or win probability columns.

Returns

Cleaned game payload (no advBoxScore key).

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
cleaned = game.run_cleaning_pipeline()
print(len(cleaned["plays"]))

CFBPlayProcess.run_processing_pipeline​

CFBPlayProcess.run_processing_pipeline(fourth_down_probs: 'bool' = True, two_pt_probs: 'bool' = True, validate: 'bool' = False)

Run the full play-by-play processing pipeline.

Applies every scoring/feature step in order: down detection, play type flags, rush/pass flags, team score variables, new play types, penalty setup, play category flags, yardage cols, player cols, after cols, spread time, EPA, WPA, drive data, and QBR. Also produces an advanced box score and stores it under advBoxScore on the returned dict.

Idempotent -- subsequent calls return the cached self.json.

Parameters

ParameterTypeDefaultDescription
fourth_down_probsboolTruewhen True (default), run the cfb4th decision surface (sportsdataverse.cfb.cfb_fourth_down.get_4th_down_probs) on the enriched frame and append the go/field-goal/punt WP columns plus the fourth_down_recommendation to 4th-down plays (null elsewhere). Pass False to skip it (e.g. to avoid loading the fourth-down model).
two_pt_probsboolTruewhen True (default), run the cfb4th two-point decision surface (sportsdataverse.cfb.cfb_two_point.get_2pt_probs) and append two_pt_wp / xp_wp / prob_2pt / two_pt_recommendation / two_pt_wp_diff to point-after / two-point rows (null elsewhere).
validateboolFalsewhen True, score the processed frame with the packaged per-game gate (sportsdataverse.validation) and attach its report dict under the "validation" key of the processed game ({} when the pipeline produced no plays). Name "validation" in return_keys to get it back when a subset was requested. Off by default -- the gate costs a few milliseconds and most callers do not read it.

Returns

The fully-processed game payload. If the constructor was given return_keys, only those keys are returned. Its plays are the feed's plays without the administrative rows (coin toss, period and game markers, drive banners) and ESPN's duplicate copies, so there are fewer of them than the summary's drive plays. Key a play on id (play_id, right after it, is the same value as an Int64): before 2005 sequenceNumber restarts with every drive. qb_hurry and the hurrier columns (qb_hurry_player_name / _jersey / _id, and ...2 for a second hurrier) come from ESPN's "hurried by" phrase, which records hurried incompletions, not every pressure: on 2026 FBS Weeks 1-12 it is on 8.6% of dropbacks (7.7-9.7% by conference), 21.8% of incompletions, 1.0% of completions and 2.8% of sacks, and 236 of 1,517 FBS defense-games have none. A count of hurries is a floor, not a pressure rate. The hurrier's id is the defense's athlete with that jersey and surname in the game roster or box score (98.5% of the 2026 names), else a name match on the defense.

Example

from sportsdataverse.cfb import CFBPlayProcess
game = CFBPlayProcess(gameId=401628334)
game.espn_cfb_pbp()
processed = game.run_processing_pipeline()
print(processed["advBoxScore"].keys())

# Pipeline next step (return only selected keys)

game = CFBPlayProcess(gameId=401628334, return_keys=["plays", "advBoxScore"])
game.espn_cfb_pbp()
trimmed = game.run_processing_pipeline()

cfb_advanced_stats​

cfb_advanced_stats(seasons: 'Union[int, list[int]]', *, adjust: 'bool' = True, exclude_garbage: 'bool' = True, as_of_date: 'Optional[datetime.date]' = None, config: 'Optional[AdjustConfig]' = None, return_as_pandas: 'bool' = False) -> 'Union[pl.DataFrame, pd.DataFrame]'

Team-season CFB advanced stats: efficiency, explosiveness, havoc.

Loads play-by-play via load_cfb_pbp, builds the garbage-filtered per-play long frame, aggregates raw per-team offense/defense success rate, EPA/play, isoPPP (mean EPA on successful plays), explosive rate and havoc, and (default) opponent-adjusts each metric with the iterative solver.

Parameters

ParameterTypeDefaultDescription
seasonsUnion[int, list[int]]season or list of seasons (hosted pbp covers 2002-2021).
adjustboolTrueadd adj_* opponent-adjusted columns + EPA ranks.
exclude_garbageboolTruedrop Connelly garbage-time plays.
as_of_dateOptional[date]Noneleakage boundary -- only plays strictly before this date contribute.
configOptional[AdjustConfig]NoneAdjustConfig for the solver.
return_as_pandasboolFalsereturn a pandas DataFrame instead of polars.

Returns

One row per (season, team_id) with the raw columns (and adj_* plus off_epa_rank/def_epa_rank when adjust=True). Empty input returns a zero-row frame with the documented schema.

col_nametypedescription
seasonInt64Season the stats cover.
team_idStringTeam ESPN id (character join key).
playsInt64Situation-neutral offensive plays in the aggregate.
off_success_rateFloat64Offensive success rate (yards gained >= 50/70/100 percent of distance by down).
def_success_rateFloat64Success rate allowed (Connelly 50/70/100 yardage rule).
off_epa_playFloat64Raw offensive EPA per play on the garbage-filtered substrate (garbage time excluded by default; pass exclude_garbage=False to keep it).
def_epa_playFloat64Raw EPA allowed per play on the garbage-filtered substrate (garbage time excluded by default; pass exclude_garbage=False to keep it).
off_iso_pppFloat64Mean EPA on successful offensive plays (Connelly isoPPP explosiveness).
def_iso_pppFloat64Mean EPA allowed on successful plays faced (isoPPP against).
off_explosive_rateFloat64Share of offensive plays that were explosive (pass EPA >= 2.4, rush EPA >= 1.8).
def_explosive_rateFloat64Share of plays faced that were explosive (pass EPA >= 2.4, rush EPA >= 1.8).
def_havocFloat64Share of plays faced with a havoc event (TFL, pass breakup, interception, forced fumble).
off_havoc_allowedFloat64Share of offensive plays on which the defense recorded a havoc event.
off_epa_success_rateFloat64Share of offensive plays with EPA > 0 (EPA-based success rate).
adj_off_epa_playFloat64Opponent-adjusted offensive EPA per play (higher is better).
adj_off_success_rateFloat64Opponent-adjusted offensive success rate.
adj_off_explosive_rateFloat64Opponent-adjusted offensive explosive-play rate.
adj_def_epa_playFloat64Opponent-adjusted EPA allowed per play (lower is better).
adj_def_success_rateFloat64Opponent-adjusted success rate allowed.
adj_def_explosive_rateFloat64Opponent-adjusted explosive-play rate allowed.
adj_def_havocFloat64Opponent-adjusted havoc rate created by the defense.
adj_off_havoc_allowedFloat64Opponent-adjusted havoc rate the offense allows.
off_epa_rankInt64Dense rank on adj_off_epa_play descending (best offense = 1).
def_epa_rankInt64Dense rank on adj_def_epa_play ascending (fewest EPA allowed = 1).

Example

from sportsdataverse.cfb import cfb_advanced_stats
df = cfb_advanced_stats([2021])
print(df.shape)

# Raw only, garbage time kept

df_raw = cfb_advanced_stats(2021, adjust=False, exclude_garbage=False)

# Pipeline next step (one line)

df.sort("adj_off_epa_play", descending=True).head()

cfb_standings​

cfb_standings(games: 'FrameLike', teams: 'FrameLike', *, tiebreaker_depth: 'str' = 'SOS', playoff_seeds: 'int | None' = None, rankings: 'FrameLike | None' = None, tiebreaker_data: 'dict[str, FrameLike] | None' = None, season: 'int | None' = None, return_as_pandas: 'bool' = False, rng: 'np.random.Generator | None' = None) -> 'pl.DataFrame | Any'

Compute college football standings with conference ranks and champions.

Engine design adapted from nflseedR (MIT, Sebastian Carl & Lee Sharpe); see the module docstring for the documented CFB simplifications, and its "Official per-conference tiebreakers (registry)" section for how CONFERENCE_TIEBREAKERS overrides the generic cascade for the SEC, Big Ten, Big 12, ACC, MAC, American, Conference USA, Mountain West, Sun Belt and (from 2026) Pac-12.

Parameters

ParameterTypeDefaultDescription
gamesFrameLikeGame results with columns sim (or season), week, game_type (REG | CONF_CHAMP | POST), home_team, away_team, result (home margin: home - away; null = unplayed), optional neutral (0/1), and optional home_points/away_points (per-game scores — feeds the SEC capped-scoring-margin rung; cfb_games_from_schedule emits both). Either optional input absent -> that rung is skipped, not an error. Optional conf_game (bool; the schedule's flag, from cfb_games_from_schedule): False keeps a same-conference game out of conference play and its tiebreakers (overall record and Big 12 total_wins keep it).
teamsFrameLikeTeam table with columns team and conference (null or "FBS Independents" marks an independent), and an optional division column ("FBS"/"FCS" or similar) that feeds the Big 12 total_wins FCS cap and keeps non-FBS teams out of CFP seeding (see cfb_playoff_seeds); absent -> the cap degrades to uncapped win totals, noted in tiebreak_notes. Optional conf_division (in-conference division name: with two or more divisions each division's best eligible team is champion and the champions take the top ranks (1-2 for two divisions); it also feeds the Sun Belt div_pct rung) and postseason_eligible (bool; an explicit False team is ranked behind every eligible one so it cannot hold a championship-game berth, while its games still count).
tiebreaker_depthstr'SOS'One of "RANDOM", "PRE-SOV", "SOS", "POINTS" — the nflseedR depth ladder. Steps beyond the chosen depth are skipped and remaining ties are broken by coin flip. Gates ONLY the generic fallback cascade; registered official conference procedures (below) always run in full.
playoff_seedsint | NoneNoneIf set, adds a seed column via cfb_playoff_seeds with this field size (the season's CFP selection rule, resolved like the tiebreaker epochs).
rankingsFrameLike | NoneNoneOptional committee-style rankings frame (team, rank) forwarded to cfb_playoff_seeds.
tiebreaker_datadict[str, FrameLike] | NoneNoneOptional external inputs for the registry rungs, as a dict of frames: "analytics_ratings" (team, rating — the analytics_rating rung: Big Ten/Big 12/ACC/MAC, and the American/CUSA/Mountain West/Sun Belt/Pac-12 metric composites), "cfp_rankings" (team, rank — the cfp_ranked_final_week clause of the American/CUSA/Sun Belt and the Pac-12 two-team cfp_ranking rung) and "apr" (team, apr — the CUSA apr rung). Missing -> the rung is skipped, noted.
seasonint | NoneNoneSeason whose rules apply (registry epochs and the CFP selection rule) to every sim. None (default): when games is keyed by season each id is its own season, otherwise (plain sim ids) the current rules apply.
return_as_pandasboolFalseReturn a pandas DataFrame instead of polars.
rngGenerator | NoneNoneOptional numpy Generator used only for coin-flip tiebreaks (simulations pass their seeded generator through here).

Returns

A polars (or pandas) DataFrame with one row per (sim, team): overall record (games/wins/losses/ties/win_pct/ pd), conference record (conf_*), sov, sos, conf_rank (null for independents), conf_champ, division (if teams has it) and, with playoff_seeds, seed. The result also carries a tiebreak_notes list of skipped-rung messages (see the module docstring): result.tiebreak_notes for a polars frame, result.attrs["tiebreak_notes"] for a pandas frame (pandas' own metadata mechanism — avoids its "new attribute" warning).

col_nametypedescription
simInt64Season or simulation identifier the standings row belongs to.
teamStringTeam name (join key across the seedr engine frames).
conferenceStringConference the team belongs to; null or "FBS Independents" marks an independent.
gamesInt64Total games played across all game types (regular season, conference championship and postseason).
winsInt64Wins across all played games (conference championship and postseason included).
lossesInt64Losses across all played games.
tiesInt64Ties across all played games.
win_pctFloat64Overall win percentage - (wins + 0.5 * ties) / games, 0.0 when no games have been played.
pdFloat64Point differential (points for minus points against, via game margins) summed over all played games.
conf_gamesInt64Number of conference regular-season games played (both teams in the same conference; CONF_CHAMP games excluded).
conf_winsInt64Wins in conference regular-season games.
conf_lossesInt64Losses in conference regular-season games.
conf_tiesInt64Ties in conference regular-season games.
conf_pctFloat64Conference win percentage - (conf_wins + 0.5 * conf_ties) / conf_games, 0.0 with no conference games; the primary sort key for conference ranks.
conf_pdFloat64Point differential summed over conference regular-season games only; the POINTS-depth tiebreaker rung.
sovFloat64Strength of victory, conference-REG-scoped (unlike nflseedR's overall version) - the pooled sos formula over conference victories only; 0.0 for independents or teams without conference wins.
sosFloat64Strength of schedule, conference-REG-scoped (unlike nflseedR's overall version) - conference opponents' summed conference wins (ties half) over their summed conference games, one term per conference game played (pooled, as cfbseedR); 0.0 for independents.
conf_rankInt64Rank within the conference from the tiebreaker cascade (1 = best); null for independents.
conf_champBooleanWhether the team is its conference's champion - the CONF_CHAMP game winner when one was played, otherwise the conference's rank-1 team; always false for independents.

Raises

ExceptionDescription
ValueErrorIf required columns are missing, tiebreaker_depth / game_type values are invalid, or teams / rankings / a tiebreaker_data frame has duplicate team rows.

Example

import polars as pl
from sportsdataverse.cfb import cfb_standings

games = pl.DataFrame({
"sim": [2024, 2024], "week": [1, 2],
"game_type": ["REG", "REG"],
"home_team": ["A", "B"], "away_team": ["B", "A"],
"result": [7.0, -3.0], "neutral": [0, 0],
})
teams = pl.DataFrame({"team": ["A", "B"], "conference": ["X", "X"]})
print(cfb_standings(games, teams))

# With CFP seeds from committee rankings

st = cfb_standings(games, teams, playoff_seeds=12, rankings=ranks_df)

# With an official-registry analytics rating input

ratings = pl.DataFrame({"team": ["A", "B"], "rating": [92.1, 88.4]})
st = cfb_standings(games, teams, tiebreaker_data={"analytics_ratings": ratings})
print(st.tiebreak_notes)

espn_cfb_player_stats​

espn_cfb_player_stats(athlete_id: 'int', season: 'int', *, season_type: 'str' = 'regular', total: 'bool' = False, raw: 'bool' = False, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> 'pl.DataFrame | pd.DataFrame | dict[str, Any]'

Pull a college-football athlete's ESPN season stat line.

See sportsdataverse.wbb.espn_wbb_player_stats for full documentation of the wide return shape, the {category}_{stat} stat columns (for football: passing_*, rushing_*, receiving_*, scoring_*, ...), the athlete / team metadata blocks, and the season_type / total parameters. For the richer multi-category web-v3 payload use sportsdataverse.cfb.espn_cfb_player_stats_v3.

Parameters

ParameterTypeDefaultDescription
athlete_idintESPN college-football athlete identifier.
seasonintSeason year, used in the core-v2 path.
season_typestr'regular'"regular" (type 2) or "postseason" (type 3).
totalboolFalseForward-compat totals passthrough.
rawboolFalseIf True, returns the raw core-v2 statistics JSON dict.
return_as_pandasboolFalseIf True, returns a pandas DataFrame; else polars.

Returns

A single-row wide DataFrame (polars by default). When raw=True returns the raw statistics JSON dict.

col_nametypedescription
seasonInt64Season (4-digit year).
season_typeStringESPN season type (2 = regular, 3 = postseason).
totalBoolean
athlete_idInt64ESPN athlete id.
athlete_uidString
athlete_guidString
athlete_typeString
first_nameStringAthlete first name.
last_nameStringAthlete last name.
full_nameStringVenue full name (e.g. Tenney Stadium).
display_nameStringHuman-readable metric name.
short_nameStringRanking source short name (e.g. AP Poll).
weightFloat64Listed weight (lbs).
display_weightStringHuman-readable weight (e.g. 205 lbs).
heightFloat64Listed height (inches).
display_heightStringHuman-readable height (e.g. 6' 1").
ageInt64
date_of_birthStringPlayer date of birth (if published).
jerseyStringJersey number.
slugStringURL slug for the team.
activeBooleanTRUE if the player was active for the game.
position_idInt64ESPN position id.
position_nameStringPosition name (e.g. Quarterback).
position_display_nameStringHuman-readable position name.
position_abbreviationStringPosition abbreviation (e.g. QB).
college_nameString
status_idInt64ESPN commitment status id.
status_nameStringStatus-type key (e.g. STATUS_FINAL).
general_fumblesFloat64Total number of fumbles committed by the player across all offensive and special-teams plays.
general_fumbles_lostFloat64Number of fumbles the player committed that were recovered by the opposing team.
general_fumbles_touchdownsFloat64Total touchdowns scored by the player as a result of fumble recoveries, combining offensive and defensive occurrences.
general_games_playedFloat64
general_offensive_two_pt_returnsFloat64Number of two-point conversions the player scored by returning a blocked or intercepted two-point attempt on the offensive side.
general_offensive_fumbles_touchdownsFloat64Number of touchdowns scored by the player on fumble recoveries credited to the offensive category.
general_defensive_fumbles_touchdownsFloat64Number of touchdowns scored by the player on fumble recoveries attributed to the defensive category.
passing_avg_gainFloat64Average yards gained per passing play attempt by the quarterback in the passing category.
passing_completion_pctFloat64Percentage of pass attempts thrown by the quarterback that were completed, calculated as completions divided by attempts.
passing_completionsFloat64Pass completions (split from CFBD's C/ATT field).
passing_espnqb_ratingFloat64ESPN's proprietary quarterback rating for the player's passing performance, factoring in efficiency metrics beyond traditional passer rating.
passing_interception_pctFloat64Percentage of pass attempts that resulted in an interception, calculated as interceptions divided by passing attempts.
passing_interceptionsFloat64Total number of passes thrown by the quarterback that were intercepted by the defense.
passing_long_passingFloat64Longest single completed pass in yards recorded by the quarterback during the stat period.
passing_net_passing_yardsFloat64Net passing yards gained by the quarterback after subtracting yardage lost on sacks from gross passing yards.
passing_net_passing_yards_per_gameFloat64Net passing yards per game for the quarterback, computed as net passing yards divided by games played.
passing_net_total_yardsFloat64Combined net yardage from passing and rushing for a quarterback, accounting for sack yardage lost in the passing category.
passing_net_yards_per_gameFloat64Net total yards gained per game for the player as recorded in the passing category context.
passing_passing_attemptsFloat64Total number of pass attempts thrown by the quarterback, including completions, incompletions, and interceptions.
passing_passing_big_playsFloat64Number of passing plays that gained 20 or more yards as recorded for the quarterback.
passing_passing_first_downsFloat64Number of first downs gained by the team on passing plays thrown by the quarterback.
passing_passing_fumblesFloat64Number of fumbles the quarterback committed during passing plays, including fumbled snaps and sack fumbles.
passing_passing_fumbles_lostFloat64Number of fumbles the quarterback committed on passing plays that were recovered by the opposing team.
passing_passing_touchdown_pctFloat64Percentage of pass attempts that resulted in a passing touchdown, calculated as touchdowns divided by attempts.
passing_passing_touchdownsFloat64Total number of touchdown passes thrown by the quarterback.
passing_passing_yardsFloat64Gross passing yards gained by the quarterback on completed passes.
passing_passing_yards_after_catchFloat64Total yards gained by receivers after the catch on passes thrown by the quarterback.
passing_passing_yards_at_catchFloat64Total yards gained at the point of the catch (air yards) on passes thrown by the quarterback, before any yards after catch.
passing_passing_yards_per_gameFloat64Gross passing yards per game for the quarterback, computed as passing yards divided by games played.
passing_qb_ratingFloat64Traditional NCAA passer rating for the quarterback, calculated from completion percentage, yards per attempt, touchdown rate, and interception rate.
passing_sacksFloat64Total number of times the quarterback was sacked (tackled behind the line of scrimmage on a passing play).
passing_sack_yards_lostFloat64Total yards lost by the quarterback as a result of being sacked, subtracted when computing net passing yards.
passing_team_games_playedFloat64Number of team games played during the stat period, used as the denominator for per-game passing rate statistics.
passing_total_offensive_playsFloat64Total number of offensive plays (pass attempts plus rushes) for the team during the stat period, recorded in the passing category context.
passing_total_points_per_gameFloat64Average total points scored per game by the player's team as recorded alongside passing statistics.
passing_total_touchdownsFloat64Total touchdowns accounted for by the quarterback across passing and rushing in the passing category context.
passing_total_yardsFloat64Total offensive yardage (passing plus rushing) accumulated by the quarterback as reported in the passing category.
passing_total_yards_from_scrimmageFloat64Total yards from scrimmage accumulated by the quarterback (passing plus rushing yards) in the passing category context.
passing_two_point_pass_convsFloat64Number of successful two-point conversions the quarterback converted via a passing play.
passing_two_pt_passFloat64Indicator or count of two-point conversion passing attempts recorded for the quarterback.
passing_two_pt_pass_attemptsFloat64Total number of two-point conversion attempts the quarterback made via a passing play.
passing_yards_from_scrimmage_per_gameFloat64Average yards from scrimmage per game for the quarterback as reported in the passing category.
passing_yards_per_completionFloat64Average yards gained per completed pass by the quarterback, calculated as passing yards divided by completions.
passing_yards_per_gameFloat64Average gross passing yards per game for the quarterback, equivalent to passing_passing_yards_per_game.
passing_yards_per_pass_attemptFloat64Average yards gained per pass attempt by the quarterback, calculated as passing yards divided by attempts.
passing_net_yards_per_pass_attemptFloat64Net passing yards divided by total pass attempts, including sack yardage lost in the denominator's context.
passing_qbrFloat64ESPN Quarterback Rating (QBR) for the player in this game.
passing_adj_qbrFloat64ESPN's adjusted Total Quarterback Rating (QBR) for the player's passing performance, controlling for opponent difficulty and game situation.
passing_quarterback_ratingFloat64Traditional passer rating for the quarterback, equivalent to passing_qb_rating, using the standard NCAA formula.
passing_offensive_snap_pctFloat64ESPN's offensiveSnapPct stat (described upstream as '% of plays the player was on the field'); 0.0 for every college player checked, so ESPN does not appear to populate it for college football.
passing_target_share_pctFloat64ESPN's targetSharePct stat (described upstream as '% of total team targets'); 0.0 for every college player checked, so ESPN does not appear to populate it for college football.
passing_yards_per_route_runFloat64ESPN's yardsPerRouteRun stat (yards per route run, YPRR) under the passing category; 0.0 for every college player checked, so ESPN does not appear to populate it for college football.
passing_avg_depth_of_targetFloat64ESPN's avgDepthOfTarget stat (average depth of target, aDOT) under the passing category; 0.0 for every college player checked, so ESPN does not appear to populate it for college football.
rushing_avg_gainFloat64Average yards gained per rushing attempt for the player in the rushing category.
rushing_espnrb_ratingFloat64ESPN's proprietary running back rating for the player's rushing performance.
rushing_long_rushingFloat64Longest single rushing carry in yards recorded by the player during the stat period.
rushing_net_total_yardsFloat64Net total yardage accumulated by the player from rushing and any receiving contributions as reported in the rushing category.
rushing_net_yards_per_gameFloat64Net total yards per game for the player as reported in the rushing category context.
rushing_rushing_attemptsFloat64Total number of rushing attempts (carries) credited to the player.
rushing_rushing_big_playsFloat64Number of rushing plays that gained 10 or more yards for the player.
rushing_rushing_first_downsFloat64Number of first downs gained by the player via rushing plays.
rushing_rushing_fumblesFloat64Number of fumbles the player committed on rushing plays.
rushing_rushing_fumbles_lostFloat64Number of fumbles the player committed on rushing plays that were recovered by the opposing team.
rushing_rushing_touchdownsFloat64Total number of rushing touchdowns scored by the player.
rushing_rushing_yardsFloat64Total yards gained by the player on rushing attempts.
rushing_rushing_yards_per_gameFloat64Average rushing yards per game for the player, calculated as rushing yards divided by games played.
rushing_stuffsFloat64Number of rushing attempts in which the player was stopped at or behind the line of scrimmage.
rushing_stuff_yards_lostFloat64Total yards lost by the player on stuffed rushing plays (carries stopped at or behind the line of scrimmage).
rushing_team_games_playedFloat64Number of team games played during the stat period, used as the denominator for per-game rushing rate statistics.
rushing_total_offensive_playsFloat64Total number of offensive plays for the team during the stat period, recorded in the rushing category context.
rushing_total_points_per_gameFloat64Average total points scored per game by the player's team as recorded alongside rushing statistics.
rushing_total_touchdownsFloat64Total touchdowns scored by the player across all methods as reported in the rushing category context.
rushing_total_yardsFloat64Total offensive yardage accumulated by the player as reported in the rushing category.
rushing_total_yards_from_scrimmageFloat64Total yards from scrimmage for the player (rushing plus receiving yards) as reported in the rushing category.
rushing_two_point_rush_convsFloat64Number of successful two-point conversions the player converted via a rushing play.
rushing_two_pt_rushFloat64Indicator or count of two-point conversion rushing attempts recorded for the player.
rushing_two_pt_rush_attemptsFloat64Total number of two-point conversion attempts the player made via a rushing play.
rushing_yards_from_scrimmage_per_gameFloat64Average yards from scrimmage per game for the player as reported in the rushing category.
rushing_yards_per_gameFloat64Average rushing yards per game for the player, equivalent to rushing_rushing_yards_per_game.
rushing_yards_per_rush_attemptFloat64Average yards gained per rushing attempt for the player, calculated as rushing yards divided by attempts.
receiving_avg_gainFloat64Average yards gained per reception for the player in the receiving category.
receiving_espnwr_ratingFloat64ESPN's proprietary wide receiver / pass-catcher rating for the player's receiving performance.
receiving_long_receptionFloat64Longest single reception in yards recorded by the player during the stat period.
receiving_net_total_yardsFloat64Net total yardage accumulated by the player from receiving and any rushing contributions as reported in the receiving category.
receiving_net_yards_per_gameFloat64Net total yards per game for the player as reported in the receiving category context.
receiving_receiving_big_playsFloat64Number of receiving plays that gained 20 or more yards for the player.
receiving_receiving_first_downsFloat64Number of first downs gained by the player via receptions.
receiving_receiving_fumblesFloat64Number of fumbles the player committed after catching a pass.
receiving_receiving_fumbles_lostFloat64Number of fumbles the player committed on receiving plays that were recovered by the opposing team.
receiving_receiving_targetsFloat64Total number of times the player was targeted as the intended receiver on a pass play.
receiving_receiving_touchdownsFloat64Total number of touchdown receptions scored by the player.
receiving_receiving_yardsFloat64Total yards gained by the player on completed receptions.
receiving_receiving_yards_after_catchFloat64Total yards gained by the player after the catch on receiving plays.
receiving_receiving_yards_at_catchFloat64Total air yards gained at the point of the catch on receiving plays, before any yards after catch.
receiving_receiving_yards_per_gameFloat64Average receiving yards per game for the player, calculated as receiving yards divided by games played.
receiving_receptionsFloat64Total number of completed receptions (catches) recorded by the player.
receiving_team_games_playedFloat64Number of team games played during the stat period, used as the denominator for per-game receiving rate statistics.
receiving_total_offensive_playsFloat64Total number of offensive plays for the team during the stat period, recorded in the receiving category context.
receiving_total_points_per_gameFloat64Average total points scored per game by the player's team as recorded alongside receiving statistics.
receiving_total_touchdownsFloat64Total touchdowns scored by the player across all methods as reported in the receiving category context.
receiving_total_yardsFloat64Total offensive yardage accumulated by the player as reported in the receiving category.
receiving_total_yards_from_scrimmageFloat64Total yards from scrimmage for the player (receiving plus rushing yards) as reported in the receiving category.
receiving_two_point_rec_convsFloat64Number of successful two-point conversions the player converted via a reception.
receiving_two_pt_receptionFloat64Indicator or count of two-point conversion receptions recorded for the player.
receiving_two_pt_reception_attemptsFloat64Total number of two-point conversion attempts the player made via a receiving play.
receiving_yards_from_scrimmage_per_gameFloat64Average yards from scrimmage per game for the player as reported in the receiving category.
receiving_yards_per_gameFloat64Average receiving yards per game for the player, equivalent to receiving_receiving_yards_per_game.
receiving_yards_per_receptionFloat64Average yards gained per reception for the player, calculated as receiving yards divided by receptions.
scoring_defensive_pointsFloat64Total points scored by the player through defensive plays such as defensive touchdowns, safeties, or fumble-return scores.
scoring_field_goalsFloat64Total number of field goals made by the player in the scoring category.
scoring_kick_extra_pointsFloat64Total number of extra point attempts kicked by the player.
scoring_kick_extra_points_madeFloat64Total number of successful extra points (PATs) kicked by the player.
scoring_misc_pointsFloat64Points scored by the player through miscellaneous means not captured by standard scoring categories.
scoring_passing_touchdownsFloat64Total touchdown passes thrown by the player as counted in the scoring category.
scoring_receiving_touchdownsFloat64Total touchdown receptions scored by the player as counted in the scoring category.
scoring_return_touchdownsFloat64Total touchdowns scored by the player on kick or punt returns as counted in the scoring category.
scoring_rushing_touchdownsFloat64Total rushing touchdowns scored by the player as counted in the scoring category.
scoring_total_pointsFloat64Total points scored by the player across all scoring methods during the stat period.
scoring_total_points_per_gameFloat64Average total points scored by the player per game during the stat period.
scoring_total_touchdownsFloat64Total touchdowns scored by the player across all methods (passing, rushing, receiving, and return) in the scoring category.
scoring_total_two_point_convsFloat64Total number of successful two-point conversions scored by the player across passing, rushing, and receiving attempts.
scoring_two_point_pass_convsFloat64Number of successful two-point conversions the player scored via a passing play, as counted in the scoring category.
scoring_two_point_rec_convsFloat64Number of successful two-point conversions the player scored via a reception, as counted in the scoring category.
scoring_two_point_rush_convsFloat64Number of successful two-point conversions the player scored via a rushing play, as counted in the scoring category.
scoring_one_pt_safeties_madeFloat64Number of one-point safeties scored by the player's team, credited in the scoring category.
team_idInt64ESPN team id.
team_uidString
team_guidString
team_slugStringTeam slug for the stat row.
team_locationStringTeam location / school name.
team_nameStringTeam nickname.
team_abbreviationStringTeam abbreviation.
team_display_nameStringFull team display name.
team_short_display_nameStringShort team display name.
team_colorStringPrimary team color.
team_alternate_colorStringAlternate team color.
team_is_activeBoolean
team_logo_hrefStringDefault team logo URL.

Raises

ExceptionDescription
ValueErrorseason_type is not "regular"/"postseason".
sportsdataverse.errors.NoDataErrorESPN returned 404.
sportsdataverse.errors.AssetFetchErrorThe statistics, athlete or team fetch failed (403, 429, 5xx, a dead connection); only a 404 on the athlete or team node leaves those columns null.

Example

from sportsdataverse.cfb import espn_cfb_player_stats
df = espn_cfb_player_stats(athlete_id=4426338, season=2023)
df.select(["full_name", "team_display_name", "passing_passing_yards"])

espn_cfb_schedule​

espn_cfb_schedule(dates=None, week=None, season_type=None, groups=None, limit=500, return_as_pandas=False, **kwargs) -> 'pl.DataFrame'

espn_cfb_schedule - look up the college football schedule for a given season

Parameters

ParameterTypeDefaultDescription
datesintNoneUsed to define different seasons. 2002 is the earliest available season.
weekintNoneWeek of the schedule.
season_typeintNone2 for regular season, 3 for post-season, 4 for off-season.
groupsintNoneUsed to define different divisions. 80 is FBS, 81 is FCS.
limitint500number of records to return, default: 500.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing schedule dates for the requested season. A day with no games returns a zero-row frame carrying the documented columns.

col_nametypedescription
idInt64247Sports referencing id for the recruit.
uidStringESPN global unique identifier.
dateStringDate of the poll release.
attendanceInt64Reported attendance at the game.
time_validBoolean
date_validBooleanBoolean flag indicating whether the game's scheduled date is confirmed and valid.
neutral_siteBooleanTRUE/FALSE flag for if the game took place at a neutral site.
conference_competitionBoolean
play_by_play_availableBoolean
recentBoolean
start_dateStringSeason start timestamp (ISO 8601, UTC).
broadcastStringBroadcast network short name.
highlightsListGame highlight urls.
notes_typeString
notes_headlineString
broadcast_marketString
broadcast_nameString
type_idInt64Play-type id.
type_abbreviationStringPlay-type abbreviation (e.g. RUSH, TD).
venue_idInt64Referencing venue id.
venue_full_nameString
venue_address_cityString
venue_address_stateString
venue_address_countryStringCountry in which the game venue is located, as provided by ESPN's venue data.
venue_indoorBooleanWhether the home venue is indoors.
status_clockFloat64
status_display_clockString
status_periodInt64
status_type_idInt64
status_type_nameString
status_type_stateString
status_type_completedBoolean
status_type_descriptionString
status_type_detailString
status_type_short_detailString
groups_idInt64
groups_nameString
groups_short_nameString
groups_is_conferenceBoolean
format_regulation_periodsInt64
home_idInt64Home team referencing id.
home_uidString
home_locationString
home_nameString
home_abbreviationString
home_display_nameString
home_short_display_nameString
home_colorString
home_alternate_colorString
home_is_activeBoolean
home_venue_idInt64
home_logoString
home_conference_idInt64
home_scoreStringHome-team score after the play.
home_current_rankInt64AP or Coaches Poll ranking of the home team at the time of the game (null if unranked).
home_linescoresListPer-period point totals for the home team, stored as an array of quarter/overtime scores.
home_recordsListWin-loss record of the home team at the time of the game, as reported by ESPN (e.g., overall or conference record).
away_idInt64Away team referencing id.
away_uidString
away_locationString
away_nameString
away_abbreviationString
away_display_nameString
away_short_display_nameString
away_colorString
away_alternate_colorString
away_is_activeBoolean
away_venue_idInt64
away_logoString
away_conference_idInt64
away_scoreStringAway-team score after the play.
away_current_rankInt64AP or Coaches Poll ranking of the away team at the time of the game (null if unranked).
away_linescoresListPer-period point totals for the away team, stored as an array of quarter/overtime scores.
away_recordsListWin-loss record of the away team at the time of the game, as reported by ESPN (e.g., overall or conference record).
game_idInt64ESPN game identifier.
seasonInt64Season (4-digit year).
season_typeInt64ESPN season type (2 = regular, 3 = postseason).
weekInt64Game week of the season.
home_logo_darkString
away_logo_darkString
home_winnerBoolean
away_winnerBoolean
status_type_alt_detailStringESPN's short extra-time label on a final ("OT", "SO"); null when the game ended in regulation.

Example

from sportsdataverse.cfb import espn_cfb_schedule
slate = espn_cfb_schedule()
print(slate.shape) # (0, n) on a day with no games

# Pull a specific week of FBS games

week5 = espn_cfb_schedule(dates=2023, week=5, season_type=2)

# Pipeline next step (extract finals only)

import polars as pl
finals = espn_cfb_schedule(dates=2023, week=5).filter(
pl.col("status_type_completed") == True
)

get_cfb_teams​

get_cfb_teams(return_as_pandas=False) -> 'pl.DataFrame'

Load college football team ID information and logos

Parameters

ParameterTypeDefaultDescription
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars dataframe containing teams available.

col_nametypedescription
team_idInt64ESPN team id.
schoolStringTeam name.
mascotStringTeam mascot.
abbreviationStringMetric abbreviation.
alt_name1StringTeam alternate name 1 (as it appears in play_text).
alt_name2StringTeam alternate name 2 (as it appears in play_text).
alt_name3StringTeam alternate name 3 (as it appears in play_text).
conferenceStringConference of the team.
divisionStringDivision in the conference for the team.
colorStringPrimary team color (hex, no #).
alt_colorStringTeam color (alternate).
logoString
logo_darkString

Example

from sportsdataverse.cfb import get_cfb_teams
teams = get_cfb_teams()
print(teams.shape)

# Pandas round-trip

teams_pd = get_cfb_teams(return_as_pandas=True)
teams_pd.head()

# Pipeline next step (build a team_id to logo URL map)

teams = get_cfb_teams()
logo_map = dict(zip(teams["team_id"], teams["logo"]))

most_recent_cfb_season​

most_recent_cfb_season()

Return the most recent college football season year based on today's date.

The college football season starts in mid-August. If today is on or after August 15 (or any day in September or later), this returns the current calendar year. Otherwise, it returns the previous calendar year.

Returns

The most recent CFB season year.

Example

from sportsdataverse.cfb import most_recent_cfb_season
year = most_recent_cfb_season()
print(year)

# Combine with the loaders for a "current season" pull

from sportsdataverse.cfb import load_cfb_schedule, most_recent_cfb_season
sched = load_cfb_schedule(seasons=[most_recent_cfb_season()])

to_cfbfastr​

to_cfbfastr(pbp: 'pl.DataFrame', *, season: "'Optional[int]'" = None, week: "'Optional[int]'" = None, drives: "'Optional[pl.DataFrame]'" = None, linescore: "'Optional[pl.DataFrame]'" = None, drive_titles: "'Optional[pl.DataFrame]'" = None, ot_drives: "'Optional[pl.DataFrame]'" = None, scoring_summary: "'Optional[pl.DataFrame]'" = None, return_as_pandas: 'bool' = False) -> "'Union[pl.DataFrame, pd.DataFrame]'"

cfbfastR-named play frame from the NCAA structural pbp frame.

Parameters

ParameterTypeDefaultDescription
pbpDataFrameOutput of sportsdataverse.cfb.cfb_ncaa_pbp.parse_cfb_ncaa_pbp (one game).
seasonOptional[int]NoneSeason year (2025 = fall-2025), written to season/year.
weekOptional[int]NoneOptional week number (from the schedule master).
drivesOptional[DataFrame]NoneOptional sportsdataverse.cfb.cfb_ncaa_box.parse_cfb_ncaa_drives frame -- refines period per drive when quarter markers are missing from the pbp page.
linescoreOptional[DataFrame]NoneOptional sportsdataverse.cfb.cfb_ncaa_box.parse_cfb_ncaa_linescore frame -- provides home/away team names and the official per-team finals.
drive_titlesOptional[DataFrame]NoneOptional sportsdataverse.cfb.cfb_ncaa_pbp.parse_cfb_ncaa_drive_titles frame -- authoritative per-drive team labels (fixes graduated-parser team truncation) and running-score checkpoints the play-level score snaps to at each drive boundary (self-heals OT scoring rules + missed events).
ot_drivesOptional[DataFrame]NoneOptional sportsdataverse.cfb.cfb_ncaa_box.parse_cfb_ncaa_drives frame for the OT-synthesis pass -- overtime rows (period > 4) are selected internally, so the full drives frame can be passed as-is.
scoring_summaryOptional[DataFrame]NoneOptional sportsdataverse.cfb.cfb_ncaa_box.parse_cfb_ncaa_scoring_summary frame -- running-score checkpoints for the synthesized OT rows and the final-drive snap.
return_as_pandasboolFalseReturn a pandas.DataFrame instead of polars.

Returns

A polars.DataFrame (or pandas.DataFrame when return_as_pandas) with one row per play (markers/furniture dropped) and the columns of CFBFASTR_SCHEMA. Empty input returns a zero-row frame carrying the documented schema. Two conventions the NCAA page forces, both matching the ESPN processor: a play wiped out by a penalty ("... NO PLAY.") is typed "Penalty" with every outcome flag False and every yardage column null (it keeps its participants, its penalty_* columns and its spot) -- except fg_made, which is null there as on every row that is not a field-goal attempt; and a try is attributed to the team that scored the touchdown, so a block-printed pair of tries carries a different pos_team per row.

No returns table is published for this function: no capture: its one-game stats.ncaa.org input comes only from a season-sized release or from raw HTML, and the season load runs longer than the capture allows.

Example

from sportsdataverse.cfb import parse_cfb_ncaa_pbp, to_cfbfastr
pbp = parse_cfb_ncaa_pbp(open("play_by_play_5362431.html").read(), contest_id=5362431)
df = to_cfbfastr(pbp, season=2024)
print(df.shape)

# Final score from the running-score columns

df.select("pos_team", "pos_team_score", "def_pos_team", "def_pos_team_score").row(-1)