Skip to main content
Version: 0.1.5

CFB — additional Python functions

Hand-written wrappers, loaders, and helpers in sportsdataverse.cfb not covered by the generated API-endpoint reference above.

Highlights​

FunctionSummary
CFBPlayProcessProcess ESPN college-football play-by-play feeds into a tidy game-level dictionary.
cfb_advanced_statsTeam-season CFB advanced stats: efficiency, explosiveness, havoc.
cfb_standingsCompute college football standings with conference ranks and champions.
espn_cfb_player_statsPull a college-football athlete's ESPN season stat line.
espn_cfb_scheduleespn_cfb_schedule - look up the college football schedule for a given season
get_cfb_teamsLoad college football team ID information and logos
most_recent_cfb_seasonReturn the most recent college football season year based on today's date.
to_cfbfastrcfbfastR-named play frame from the NCAA structural pbp frame.

ESPN​

FunctionSummary
espn_cfb_game_rostersespn_cfb_game_rosters() - Pull the game by id.
espn_cfb_play_participantsPull ESPN per-play participants for a college-football game.
espn_cfb_teamsespn_cfb_teams - look up the college football teams
scoreboard_event_parsingInternal helper that flattens an ESPN scoreboard event dict into a shape

sportsdataverse-data releases​

FunctionSummary
load_cfb_betting_linesLoad college football betting lines information
load_cfb_rosters_crosswalkLoad the current ESPN x Fox CFB rosters crosswalk (single snapshot).

On3 Recruit Database​

FunctionSummary
on3_industry_player_rankingsOn3 Industry Comparison player rankings (deprecated next/data` scrape).
on3_industry_team_rankingsOn3 Industry Comparison team rankings (deprecated next/data` scrape).
on3_player_rankingsOn3 player rankings for a class year (deprecated next/data` scrape).
on3_team_rankingsOn3 team recruiting-class rankings (deprecated next/data` scrape).

Yahoo Sports Shangrila​

FunctionSummary
yahoo_cfb_boxscoreYahoo CFB box score: team and player stats, one row per entity stat.
yahoo_cfb_player_season_statsYahoo CFB player season stats (modern; one wide row per player).
yahoo_cfb_player_season_stats_legacyYahoo CFB legacy per-category player leaders (one wide row per player).
yahoo_cfb_scoreboardYahoo CFB scoreboard (one row per game).
yahoo_cfb_team_season_statsYahoo CFB team season stats (modern; one wide row per team).
yahoo_cfb_team_season_stats_legacyYahoo CFB legacy per-category team stats (one wide row per team).
yahoo_cfb_teamsYahoo CFB team directory (one row per team).

Fox Sports API​

FunctionSummary
fox_cfb_boxscoreFox Sports CFB boxscore (long: one row per player-stat).
fox_cfb_event_matchupFox Sports cfb pregame team-stat comparison (one row per stat).
fox_cfb_event_recapFox Sports cfb postgame top performers (one row per player).
fox_cfb_event_standingsFox Sports cfb the two teams' standings context.
fox_cfb_league_conferencesFox Sports cfb conference / group directory.
fox_cfb_league_headerFox Sports cfb league header (one row).
fox_cfb_league_leadersFox Sports CFB statistical leaders (one row per player/team).
fox_cfb_league_oddsFox Sports cfb league odds board (one row per team per game).
fox_cfb_league_player_newsFox Sports cfb league-wide player news feed.
fox_cfb_league_pollsFox Sports cfb rankings / polls rendered as standings tables.
fox_cfb_league_scheduleFox Sports cfb league schedule nav selections.
fox_cfb_league_scoresFox Sports cfb league scores nav selections.
fox_cfb_league_standingsFox Sports cfb league-wide standings tables.
fox_cfb_league_stat_leadersFox Sports cfb league stats landing leaders.
fox_cfb_oddsFox Sports CFB game odds six-pack (spread / to win / total per team).
fox_cfb_pbpFox Sports CFB play-by-play (one row per play).
fox_cfb_play_processBuild a processed CFB play-by-play game from FoxSports as a backup to ESPN.
fox_cfb_scheduleFox Sports CFB full-season schedule (one row per game).
fox_cfb_scoreboardFox Sports cfb scoreboard nav selections (weeks / dates / groups).
fox_cfb_scorechipFox Sports cfb compact live score chip (raw dict -- live-only, uncaptured shape).
fox_cfb_scores_segmentFox Sports cfb one row per game in a scoreboard segment.
fox_cfb_standingsFox Sports CFB conference standings for a team's conference.
fox_cfb_team_gamelogFox Sports CFB team game log -- tidy long: one row per (game, stat).
fox_cfb_team_headerFox Sports cfb team header (one row).
fox_cfb_team_rosterFox Sports CFB team roster (one row per player).
fox_cfb_team_statsFox Sports CFB team stat leaders (one row per category leader).
fox_cfb_teamnavFox Sports cfb team directory (one row per team).
fox_cfb_teamsFox Sports CFB team directory (one row per team).
fox_to_espn_summaryAdapt a Fox cfb/event/{id}/data payload into the ESPN-summary shape.

Models and calculators​

FunctionSummary
add_era_columnsAdd the era column(s) model consumes, using ITS card's cuts.
assert_rating_scaleWarn if the ratings have drifted off the scale the constants were fit on.
calculate_completion_probabilityCompletion probability for each pass attempt.
calculate_epaExpected points added: the change in EP across a play.
calculate_expected_pointsExpected points for each row.
calculate_field_goal_probabilityField-goal make probability for each row.
calculate_fourth_downFourth-down conversion model output for each row.
calculate_qbrModel QBR for each row.
calculate_two_point_probabilityTwo-point conversion success probability.
calculate_win_probabilityWin probability for each row.
calculate_wpaWin probability added: the change in WP across a play.
calculate_xpassExpected pass probability for each row.
cfb_adjusted_epaSeason opponent-adjusted per-team EPA from a season's play-by-play.
cfb_adjusted_epa_by_gameWalk-forward (point-in-time) opponent-adjusted EPA, one row per team-game.
cfb_compute_resultsDefault results generator — nflseedR's dynamic ELO model for CFB.
cfb_draft_projectionProject NFL-draft probability per player + expected picks per team.
cfb_field_positionTeam-season field-position value: avg start, drive EP, margin, pts/drive.
cfb_predict_gamesPredict a whole schedule of games from a ratings frame (vectorized).
cfb_ratingsOne row per team: the full CFB ratings spine (off/def/ST EPA + FEI).
cfb_recruiting_projectionProject team wins / scoring margin for a season from preseason roster features.
cfb_roster_talentTeam-talent composite per team-season (247 Team Talent Composite style).
cfb_simulationsSimulate college football seasons (nflseedR-style week loop).
efficiency_ratingsOne row per team: opponent-adjusted offensive/defensive efficiency.
fei_ratingsOne row per team: opponent-adjusted per-drive efficiency (FEI-style).
fit_field_position_epFit the monotone EP-by-starting-yardline curve from a drives frame.
get_2pt_probsTwo-point-conversion decision surface (cfb4th get_2pt_wp).
get_4th_down_probsFull 4th-down decision surface (cfb4th add_4th_probs) + recommendation.
get_fg_wpExpected win probability of attempting a field goal (cfb4th get_fg_wp).
get_go_wpExpected win probability of going for it on 4th down (cfb4th get_go_wp).
get_punt_wpExpected win probability of punting on 4th down (cfb4th get_punt_wp).
load_draft_outcomesNFL draft picks with the college of each pick, for the requested draft years.
load_fp_curveLoad the bundled EP-by-yardline curve (no network, no first-use download).
load_recruit_classesLoad recruiting classes as per-recruit rows from the 247 RDB feed.
normalize_pbp_columnsAdd card-named copies of any play-by-play columns df already carries.
predict_from_cardScore df with booster, validated and ordered by the model's card.
predict_marginExpected home scoring margin from the two net ratings.
predict_totalExpected combined point total from the four efficiency ratings + tempo.
slope_for_gamesPoints per unit of rating differential, given how many games back it.
special_teams_ratingsOne row per team: a per-unit special-teams EPA composite.
win_prob_from_marginHome win probability from an expected margin via the Gaussian CDF.

Analytics​

FunctionSummary
add_play_type_canonicalAppend play_type_canonical (and optionally play_type_family).
canonical_play_type_exprBuild the polars expression mapping raw type.text to a canonical type.
cfb_adjusted_tempoTeam-season situation-neutral, opponent-adjusted tempo / pace.
cfb_games_from_scheduleMap a load_cfb_schedule() frame into the seedr engine games schema.
cfb_playoff_seedsAssign College Football Playoff seeds (current straight-seeding rule).
cfb_resumeRating-based résumé metrics: SoS, quality wins, game control, wins-above-bubble.
cfb_returning_productionReturning production per team-season (offense / defense / overall).
cfb_season_oddsRatings-driven season Monte Carlo: conference / playoff / championship odds.
cfb_transfer_impactNet transfer talent and its projected win-total impact per team-season.
cfb_transfer_movesTransfer moves inferred from year-over-year roster diffs.
create_drive_summaryBuild the StatBroadcast-style drive summary, chart, and long-play lists.
create_situational_statsBuild the situational team-stats block from a plays frame.
make_ratings_compute_resultsBuild a cfb_simulations compute_results closure from fixed ratings.
play_type_family_exprBuild the polars expression mapping a canonical type to its phase family.

IDs and crosswalks​

FunctionSummary
cfb_odds_events_crosswalkMatch The Odds API CFB events to ESPN game ids.
cfb_rosters_crosswalkBuild the ESPN x Fox x Yahoo player-id crosswalk for one team.
cfb_schedule_crosswalkBuild the ESPN x Fox x Yahoo CFB game-id crosswalk.
cfb_teams_crosswalkBuild the ESPN x Fox x Yahoo CFB team-id crosswalk.

Validation​

FunctionSummary
check_box_invariantsEvery identity the two aggregates must satisfy; violations as strings.