Skip to main content

UFL — additional Python functions

Hand-written wrappers, loaders, and helpers in sportsdataverse.football.ufl that are not generated API-endpoint wrappers (those have their own reference pages).

ESPN​

ufl_pbp​

ufl_pbp(game_id: 'Union[str, int]', *, return_as_pandas: 'bool' = False) -> "Union[pl.DataFrame, 'pd.DataFrame']"

Enriched UFL play-by-play (EP/EPA/WP/WPA/CP/CPOE).

Same shared spring-football core as ~sportsdataverse.football.xfl.xfl_pbp (see sportsdataverse.football.spring_football_ep_wp).

Capture finding: ESPN publishes no play-by-play for UFL games as of this port -- verified empty (summary.drives AND the Core v2 .../plays endpoint) across every completed 2024 + 2025 UFL game. This function returns a zero-row (contract-shaped) frame on today's real data -- not a stub -- and will pick up real rows automatically once ESPN backfills UFL play-by-play. See tests/fixtures/league_ports/FEASIBILITY.md.

Parameters

ParameterTypeDefaultDescription
game_idUnion[str, int]ESPN UFL event id.
return_as_pandasboolFalseWhen True, return a pandas.DataFrame.

Returns

One row per play with ep/epa/wp/wpa/cp/cpoe and the other enrich_nfl_pbp output columns. Zero rows today for every UFL game (see capture finding above).

col_nametypedescription
game_idString
play_idString
seasonInt64
game_halfString
posteamString
defteamString
home_teamString
half_seconds_remainingFloat64
yardline_100Int64
ydstogoInt64
downInt64
posteam_timeouts_remainingInt64
defteam_timeouts_remainingInt64
homeInt64
retractableInt64
domeInt64
outdoorsInt64
score_differentialInt64
game_seconds_remainingFloat64
spread_lineFloat64
receive_2h_koInt64
posteam_scoreInt64
defteam_scoreInt64
roofString

Example

from sportsdataverse.football.ufl import ufl_pbp

df = ufl_pbp("401638299")
print(df.height) # 0 today -- see the capture-finding note above