Skip to main content
Version: 0.1.5

NFL — additional Python functions

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

ESPN​

FunctionSummary
espn_nfl_game_rostersespn_nfl_game_rosters() - Pull the game by id.
espn_nfl_play_participantsPull ESPN per-play participants for an NFL game.
espn_nfl_player_statsPull an NFL athlete's ESPN season stat line as one wide row.
espn_nfl_scheduleespn_nfl_schedule - look up the NFL schedule for a given season
espn_nfl_teamsespn_nfl_teams - look up NFL teams
scoreboard_event_parsingNormalize one ESPN scoreboard event into a flatter shape.

NFL.com Shield API​

FunctionSummary
nfl_clear_token_cacheDrop the cached api.nfl.com token (forces a fresh mint on the next call).
nfl_game_detailsPull full api.nfl.com game details (drives + plays) by game id.
nfl_game_pbpParsed api.nfl.com play-by-play -- one row per play (polars/pandas frame).
nfl_game_scheduleList api.nfl.com games for a season/week slice (/football/v2/games).
nfl_headers_genBuild the request-header dict expected by api.nfl.com.
nfl_token_genReturn a valid api.nfl.com bearer token, minting + caching as needed.
nfl_week_gamesParsed api.nfl.com week schedule -- one row per game (polars/pandas frame).

NFL Pro​

FunctionSummary
nfl_ngs_gamecenter_overviewNGS gamecenter overview for one game -- one row per player on a side.
nfl_ngs_leadersNGS top-N "leaders" board for a single category (one row per leader play).
nfl_ngs_league_scheduleNGS league schedule -- one row per game; source of NGS gameId values.
nfl_ngs_league_schedule_currentNGS schedule for the current week -- one row per game.
nfl_ngs_league_teamsNGS team directory -- one row per team.
nfl_ngs_man_zone_ratesDescriptive man/zone coverage rates from NGS-charted labels — NOT a trained classifier.
nfl_ngs_microsite_chartNGS microsite chart catalogue -- one row per rendered player chart image.
nfl_ngs_microsite_chart_playersNGS microsite chart player index -- one row per player with a chart.
nfl_ngs_play_is_highlightLook up whether a single play is an NGS highlight -- one-row frame.
nfl_ngs_ryoeRush yards over expected per rusher-season, stabilised with EB shrinkage.
nfl_ngs_separation_oeSeparation over a built context expectation, per receiver-season.
nfl_ngs_statboardNGS season/week statboard leaderboard for a stat family (one row per player).
nfl_ngs_statboard_leadersNGS cross-stat "leaders" board, stacked long with a category column.
nfl_ngs_yac_oeYAC over expected per receiver-season, stabilised with EB shrinkage.
scrape_ngs_seasonScrape a full season of NGS statboard data, shaped like the nflverse parquet.
scrape_ngs_weekScrape one (season, week) NGS statboard slice, shaped like the nflverse parquet.

nflverse data releases​

FunctionSummary
load_combineLoad NFL Combine information
load_contractsLoad NFL Historical contracts information
load_depth_chartsLoad NFL Depth Chart data for selected seasons
load_draft_picksLoad NFL Draft picks information
load_espn_qbrLoad ESPN Total QBR (Quarterback Rating) data going back to 2006.
load_ff_opportunityLoad NFL fantasy football opportunity data from ffverse/ffopportunity
load_ff_playeridsLoad fantasy football player IDs from DynastyProcess.com
load_ff_rankingsLoad fantasy football rankings and projections
load_ftn_chartingLoad NFL FTN charting data going back to 2022
load_injuriesLoad NFL injuries data for selected seasons
load_nextgen_statsLoad NFL NextGen Stats data going back to 2016.
load_nfl_combineLoad NFL Combine information
load_nfl_contractsLoad NFL Historical contracts information
load_nfl_draft_picksLoad NFL Draft picks information
load_nfl_espn_qbrLoad ESPN Total QBR (Quarterback Rating) data going back to 2006.
load_nfl_ff_opportunityLoad NFL fantasy football opportunity data from ffverse/ffopportunity
load_nfl_ff_playeridsLoad fantasy football player IDs from DynastyProcess.com
load_nfl_ff_rankingsLoad fantasy football rankings and projections
load_nfl_nextgen_statsLoad NFL NextGen Stats data going back to 2016.
load_nfl_officialsLoad NFL Officials information
load_nfl_pfr_advstatsLoad Pro-Football Reference advanced statistics going back to 2018.
load_nfl_player_statsLoad NFL player stats data
load_nfl_playersLoad the nflverse NFL player-identity master.
load_nfl_scheduleLoad NFL schedule data
load_nfl_team_statsLoad NFL team stats data going back to 1999
load_nfl_teamsLoad NFL team ID information and logos
load_nfl_tradesLoad NFL trades data
load_officialsLoad NFL Officials information
load_participationLoad NFL play-by-play participation data for selected seasons
load_pfr_advstatsLoad Pro-Football Reference advanced statistics going back to 2018.
load_player_statsLoad NFL player stats data
load_playersLoad the nflverse NFL player-identity master.
load_rosters_weeklyLoad NFL weekly roster data for the requested seasons.
load_schedulesLoad NFL schedule data
load_snap_countsLoad NFL snap counts data for selected seasons
load_team_statsLoad NFL team stats data going back to 1999
load_teamsLoad NFL team ID information and logos
load_tradesLoad NFL trades data

Fox Sports API​

FunctionSummary
fox_nfl_boxscoreNFL boxscore (long: one row per player-stat).
fox_nfl_event_matchupFox Sports nfl pregame team-stat comparison (one row per stat).
fox_nfl_event_recapFox Sports nfl postgame top performers (one row per player).
fox_nfl_event_standingsFox Sports nfl the two teams' standings context.
fox_nfl_league_conferencesFox Sports nfl conference / group directory.
fox_nfl_league_headerFox Sports nfl league header (one row).
fox_nfl_league_leadersNFL statistical leaders (stats-con); who=player|team.
fox_nfl_league_oddsFox Sports nfl league odds board (one row per team per game).
fox_nfl_league_player_newsFox Sports nfl league-wide player news feed.
fox_nfl_league_pollsFox Sports nfl rankings / polls rendered as standings tables.
fox_nfl_league_scheduleFox Sports nfl league schedule nav selections.
fox_nfl_league_scoresFox Sports nfl league scores nav selections.
fox_nfl_league_standingsFox Sports nfl league-wide standings tables.
fox_nfl_league_stat_leadersFox Sports nfl league stats landing leaders.
fox_nfl_oddsNFL game odds six-pack (spread / to-win / total per team).
fox_nfl_pbpNFL play-by-play (one row per play; drive-based).
fox_nfl_scoreboardFox Sports nfl scoreboard nav selections (weeks / dates / groups).
fox_nfl_scorechipFox Sports nfl compact live score chip (raw dict -- live-only, uncaptured shape).
fox_nfl_scores_segmentFox Sports nfl one row per game in a scoreboard segment.
fox_nfl_standingsNFL standings for a team's conference/division.
fox_nfl_team_gamelogNFL team game log (long: one row per game-stat).
fox_nfl_team_headerFox Sports nfl team header (one row).
fox_nfl_team_rosterNFL team roster (one row per player).
fox_nfl_team_statsNFL team stat leaders by category.
fox_nfl_teamnavFox Sports nfl team directory (one row per team).

Play-by-play processing​

FunctionSummary
NFLPlayProcessProcess ESPN NFL play-by-play feeds into a tidy game-level dictionary.
build_nfl_player_statsBuild nflverse player_stats by aggregating SDV-native play-by-play.
build_nfl_player_stats_defBuild player-level defensive stats from play-by-play (nflfastR parity).
build_nfl_player_stats_kickingBuild player-level kicking stats from play-by-play (nflfastR parity).
build_nfl_rostersBuild SDV-native NFL season rosters from the public Shield API.
build_nfl_seasonCompile play-by-play for multiple NFL games into one tidy frame.
build_nfl_team_statsBuild nflverse team_stats by aggregating SDV-native play-by-play.
calculate_nfl_series_conversion_ratesCompute per-team offense + defense series conversion rates.
clean_nfl_pbpCanonicalize names/ids/teams on a play-by-play frame (nflfastR clean_pbp port).
shield_nfl_pbpBuild one NFL game's nflverse-shape play-by-play from Shield, at ANY game phase.
shield_to_espn_summaryProject one Shield game (any phase) onto an ESPN-summary-shaped dict.
team_name_fnFold historical/relocated team codes onto their current abbreviation.

Models and calculators​

FunctionSummary
adjust_pressure_pairsOpponent-adjust matchup pressure rates via an additive fixed point.
calculate_completion_probabilityCompute completion probability (CP) and CPOE for pass plays.
calculate_epaDerive expected points added (EPA) from pre-scored EP point estimates.
calculate_expected_pointsCompute expected points for provided plays.
calculate_win_probabilityCompute win probability for provided plays.
calculate_wpaDerive win probability added (WPA) from pre-scored WP point estimates.
calculate_xpassCompute expected dropback probability (xpass) and pass_oe.
calculate_xyacCompute expected yards after catch (xYAC) for intended pass plays.
efficiency_ratingsOne row per team: opponent-adjusted offense/defense EPA per play.
env_adjusted_make_probAdd base_make_prob + environment-adjusted exp_make_prob.
fg_make_probabilityPredict FG make probability from the bundled fg_model (public wrapper).
fit_nfl_field_position_epFit the NFL EP-by-starting-yardline curve from released espn_nfl_pbp plays.
get_2pt_probsThe PAT-vs-2pt decision surface for post-touchdown states (CFB-shaped).
get_2pt_wpWin probability of the PAT-vs-2pt choice after a touchdown (nfl4th get_2pt_wp).
get_4th_down_probsFull 4th-down decision surface (nfl4th add_4th_probs) + recommendation.
get_fg_wpExpected win probability of attempting a field goal (nfl4th get_fg_wp).
get_go_wpExpected win probability of going for it on 4th down (nfl4th get_go_wp).
get_punt_wpExpected win probability of punting on 4th down (nfl4th get_punt_wp).
load_nfl_fp_curveLoad the bundled NFL EP-by-yardline curve (no network).
nfl_compute_resultsCompute NFL game results for one week of a season simulation.
nfl_draft_projectionDraft outcome projection for one draft class.
nfl_fantasy_projectionFantasy-points projection: deterministic scoring of the Marcel component
nfl_kicker_ratingEnvironment-adjusted kicker FG-over-expected ratings.
nfl_line_gradesTeam-season OL pass-block + DL pass-rush grades (opponent-adjusted, EB-shrunk).
nfl_player_projectionMarcel-style next-season player projection with delta-method aging.
nfl_ratingsOne row per team: the native NFL ratings spine (off/def/ST EPA).
nfl_simulationsSimulate an NFL season from a schedule with (partially) missing results.
nfl_usage_projectionProject next-season target share, air-yards share, and WOPR.
opponent_adjusted_ridgeRidge-regress resp_col on offense + defense team indicators + HFA.
pressure_pairsPer (season, off_team, def_team) dropbacks + pressures (matchup grid).
special_teams_ratingsOne row per team: opponent-adjusted special-teams EPA per play.
team_pressure_ratesPer (season, team) raw pressure rates, both sides of the ball.

Analytics​

FunctionSummary
calculate_nfl_standingsCompute NFL division standings + conference playoff seeds.
compose_counting_projectionCompose skill and availability into a counting projection.
nfl_availability_projectionEmpirical-Bayes availability projection: expected fraction of team games.
nfl_game_scriptTeam-season pace / PROE / expected-plays engine.
nfl_play_call_probabilitiesScore the bundled play-call classifier over offensive plays.
nfl_play_call_tendenciesAggregate scored play-call probabilities to team-season tendencies.
nfl_player_propsEmpirical-Bayes player-prop projections, leakage-safe per week.
nfl_predict_gamesVectorized pregame predictions (+ display-only market edge) per game.
nfl_punter_valuePunter net-field-position value over expected.
nfl_season_standingsCompute NFL standings with the real NFL tiebreaking procedures.
nfl_special_teams_epaSpecial-teams EPA by team-unit.
playcall_featuresBuild the play-call feature frame (one row per offensive run/pass play).
player_usage_efficiencyPer-player as-of usage + efficiency with empirical-Bayes shrinkage.
predict_marginExpected home scoring margin from two net ratings.
predict_totalExpected combined point total from the four efficiency components.
team_game_pacePer team-game pace + pass-rate-over-expected.
win_prob_from_marginHome win probability from an expected margin (Gaussian margin model).

Cache and configuration​

FunctionSummary
NflConfigRuntime configuration for sdv-py NFL loaders.
cached_loaderDecorator that adds caching to a load_nfl_* function.
clear_cacheClear both memory and filesystem caches.
get_configReturn the live NflConfig singleton.
reset_configReset the active config to its env-var-derived defaults.
update_configUpdate the active config in place.

Dates and seasons​

FunctionSummary
get_current_nfl_seasonReturn the current NFL season year.
get_current_nfl_weekReturn the current NFL week (1-22).
get_current_seasonReturn the current NFL season year.
get_current_weekReturn the current NFL week (1-22).
most_recent_nfl_seasonAlias for get_current_nfl_season() mirroring nflreadr's

IDs and crosswalks​

FunctionSummary
build_nfl_playersBuild an SDV-native NFL players frame from ESPN's public athletes endpoint.
nfl_players_crosswalkPure-consumer ID crosswalk sliced from load_nfl_players.