Skip to main content
Version: 0.1.5

UFL — additional Python functions

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

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_idcharacter
play_idcharacter
seasoninteger
game_halfcharacter
posteamcharacter
defteamcharacter
home_teamcharacter
half_seconds_remainingdouble
yardline_100integer
ydstogointeger
downinteger
posteam_timeouts_remaininginteger
defteam_timeouts_remaininginteger
homeinteger
retractableinteger
domeinteger
outdoorsinteger
score_differentialinteger
game_seconds_remainingdouble
spread_linedouble
receive_2h_kointeger
posteam_scoreinteger
defteam_scoreinteger
roofcharacter

Example

from sportsdataverse.football.ufl import ufl_pbp

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