Skip to main content

WNBA — additional Python functions — ESPN

espn_wnba_calendar​

espn_wnba_calendar(season=None, ondays=None, return_as_pandas=False, **kwargs) -> 'pl.DataFrame'

espn_wnba_calendar - look up the WNBA calendar for a given season

Parameters

ParameterTypeDefaultDescription
seasonintNoneUsed to define different seasons. 2002 is the earliest available season.
ondaysbooleanNoneUsed to return dates for calendar ondays
return_as_pandasFalse

Returns

Polars dataframe containing calendar dates for the requested season.

col_nametypedescription
seasonInt64Season identifier (4-digit year or 'YYYY-YY' string).
datetimeStringThe calendar day as ESPN sends it, an ISO 8601 UTC timestamp string.
dateStringDate in YYYY-MM-DD format.
yearString4-digit year.
monthStringMonth of the calendar day as a two-digit string.
dayStringDay number within the month.
dateURLStringThe calendar day as YYYYMMDD, the dates= value of that day's scoreboard request.
urlStringRotoWire player page URL.

Raises

ExceptionDescription
ValueErrorIf season is less than 2002.

Example

from sportsdataverse.wnba import espn_wnba_calendar
cal = espn_wnba_calendar(season=2024)
print(cal.shape)
cal.head()

# Just the on-days (game-played dates), useful for batch loops

ondays = espn_wnba_calendar(season=2024, ondays=True)
for url in ondays["url"].head(3).to_list():
print(url)

espn_wnba_draft​

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

Pull ESPN WNBA draft picks for a season.

Parameters

ParameterTypeDefaultDescription
seasonintSeason year (e.g. 2024 for the 2024 WNBA Draft). Forwarded to ESPN as ?season=YYYY.
rawboolFalseIf True, returns the parsed JSON dict before any flattening.
return_as_pandasboolFalseIf True, returns a pandas DataFrame; otherwise polars.

Returns

Polars (or pandas) DataFrame with one row per draft pick. Documented columns: season, round_number, pick_number, overall_pick, team_id, team_abbreviation, team_display_name, athlete_id, athlete_first_name, athlete_last_name, athlete_full_name, athlete_display_name, athlete_position_id, athlete_position_name, athlete_position_abbreviation, athlete_height, athlete_weight, athlete_age, athlete_birth_city, athlete_birth_state, headshot_href, school_id, school_name, school_abbreviation, link_web. Fields ESPN does not inline on the draft response (e.g. first / last name, weight, age, birth location, school id) come back as None; resolve them via the athlete-info endpoint using the returned athlete_id. If raw=True, returns the raw response dict.

col_nametypedescription
seasonInt64Season identifier (4-digit year or 'YYYY-YY' string).
round_numberInt64Numeric round.
pick_numberInt64Pick number.
overall_pickInt64Overall pick.
team_idInt64Unique team identifier.
team_abbreviationStringShort team abbreviation (e.g. 'LAS').
team_display_nameStringFull team display name.
athlete_idInt64Unique athlete identifier (ESPN).
athlete_first_nameStringDrafted player's first name; null when ESPN's draft feed omits it (display_name carries the name).
athlete_last_nameStringDrafted player's last name; null when ESPN's draft feed omits it.
athlete_full_nameStringDrafted player's full name; null when ESPN's draft feed omits it.
athlete_display_nameStringAthlete display name (full).
athlete_position_idInt64ESPN position id of the drafted player.
athlete_position_nameStringAthlete position ('Guard', 'Forward', 'Center').
athlete_position_abbreviationStringAthlete position abbreviation (G / F / C).
athlete_heightStringDrafted player's height as display text, e.g. 6'0".
athlete_weightFloat64Drafted player's weight in pounds; null when ESPN does not list it.
athlete_ageInt64Drafted player's age at the draft; null when ESPN does not list it.
athlete_birth_cityStringDrafted player's birth city; null when ESPN does not list it.
athlete_birth_stateStringDrafted player's birth state; null when ESPN does not list it.
headshot_hrefStringHeadshot image URL.
school_idInt64High school / club id.
school_nameStringName of the player's school or club before the draft, e.g. Huskies, or a country for an international pick.
school_abbreviationStringAbbreviation of that school or club, e.g. CONN or ND.
link_webStringWeb link / URL.

Raises

ExceptionDescription
sportsdataverse.errors.NoDataErrorESPN returned 404.
requests.exceptions.RequestExceptionOther network failures after retries.

Example

from sportsdataverse.wnba import espn_wnba_draft
draft = espn_wnba_draft(season=2024)
print(draft.shape)
draft.select(
["overall_pick", "round_number", "team_abbreviation", "athlete_display_name", "school_name"]
).head(12)

# First-round picks only

import polars as pl
draft.filter(pl.col("round_number") == 1).head()

# Pandas round-trip — convenient for joining against your own roster table

draft_pd = espn_wnba_draft(season=2024, return_as_pandas=True)
draft_pd[["overall_pick", "athlete_display_name", "school_name"]].head()

espn_wnba_game_officials​

espn_wnba_game_officials(game_id: 'int', season: 'int | None' = None, *, raw: 'bool' = False, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> 'pl.DataFrame | pd.DataFrame | dict[str, Any]'

Pull the officials assigned to a WNBA game.

See sportsdataverse.wbb.espn_wbb_game_officials for full documentation of the column set, the empty-frame fallback when ESPN ships no officials, and the raw / return_as_pandas flag semantics.

Parameters

ParameterTypeDefaultDescription
game_idintESPN WNBA event identifier (e.g. 401620238, Minnesota at Connecticut, 2024-05-23).
seasonint | NoneNoneSeason year (recorded as output column only).
rawboolFalseIf True, returns the parsed JSON dict before any flattening.
return_as_pandasboolFalseIf True, returns a pandas DataFrame; otherwise polars.

Returns

Polars (or pandas) DataFrame with the same columns documented in sportsdataverse.wbb.espn_wbb_game_officials. If raw=True, returns the raw response dict.

col_nametypedescription
game_idInt64Unique game identifier.
seasonInt64Season as a 4-digit starting year (integer). A 'YYYY-YY' string is not accepted.
official_idStringUnique official / referee identifier.
first_nameStringPlayer's first name.
last_nameStringPlayer's last name.
full_nameStringPlayer's full name.
display_nameStringDisplay name.
position_idStringUnique position identifier.
position_nameStringListed roster position ('Guard', 'Forward', 'Center').
position_display_nameStringPosition display name.
orderInt64Display order within the result set.

Raises

ExceptionDescription
sportsdataverse.errors.NoDataErrorESPN returned 404.
requests.exceptions.RequestExceptionOther network failures after retries.

Example

from sportsdataverse.wnba import espn_wnba_game_officials
refs = espn_wnba_game_officials(game_id=401620238, season=2024)
print(refs.shape)
refs.select(["full_name", "position_name", "order"]).head()

# Pandas round-trip

refs_pd = espn_wnba_game_officials(
game_id=401620238, season=2024, return_as_pandas=True
)
refs_pd[["full_name", "position_name"]].head()

# Inspect the raw ESPN payload (e.g. for fields not flattened)

payload = espn_wnba_game_officials(game_id=401620238, season=2024, raw=True)
list(payload.keys())[:8]

espn_wnba_game_rosters​

espn_wnba_game_rosters(game_id: 'int', raw=False, return_as_pandas=False, **kwargs) -> 'pl.DataFrame | pd.DataFrame | dict'

espn_wnba_game_rosters() - Pull the game by id.

Parameters

ParameterTypeDefaultDescription
game_idintUnique game_id, can be obtained from espn_wnba_schedule().
rawboolFalseIf True, returns the Core v2 competitors payload (dict) as ESPN sent it; its roster, team and athlete $ref links are not followed.
return_as_pandasboolFalseIf True, returns a pandas dataframe. If False, returns a polars dataframe.

Returns

Polars Data frame of game roster data with columns: 'athlete_id', 'athlete_uid', 'athlete_guid', 'athlete_type', 'first_name', 'last_name', 'full_name', 'athlete_display_name', 'short_name', 'weight', 'display_weight', 'height', 'display_height', 'age', 'date_of_birth', 'slug', 'jersey', 'linked', 'active', 'alternate_ids_sdr', 'birth_place_city', 'birth_place_state', 'birth_place_country', 'headshot_href', 'headshot_alt', 'experience_years', 'experience_display_value', 'experience_abbreviation', 'status_id', 'status_name', 'status_type', 'status_abbreviation', 'hand_type', 'hand_abbreviation', 'hand_display_value', 'draft_display_text', 'draft_round', 'draft_year', 'draft_selection', 'player_id', 'starter', 'valid', 'did_not_play', 'display_name', 'ejected', 'athlete_href', 'position_href', 'statistics_href', 'team_id', 'team_guid', 'team_uid', 'team_slug', 'team_location', 'team_name', 'team_abbreviation', 'team_display_name', 'team_short_display_name', 'team_color', 'team_alternate_color', 'is_active', 'is_all_star', 'logo_href', 'logo_dark_href', 'game_id' plus the athlete's position_id, position_name, position_display_name, position_abbreviation and position_leaf. With raw=True, the competitors payload (dict).

col_nametypedescription
athlete_idInt64Unique athlete identifier (ESPN).
athlete_uidStringESPN athlete UID (universal identifier).
athlete_guidStringESPN athlete GUID.
athlete_typeStringAthlete type / class.
first_nameStringPlayer's first name.
last_nameStringPlayer's last name.
full_nameStringPlayer's full name.
athlete_display_nameStringAthlete display name (full).
short_nameStringShort display name.
weightFloat64Player weight in pounds.
display_weightStringPlayer weight in display format (e.g. '180 lbs').
heightFloat64Player height (string e.g. '6-2' or inches).
display_heightStringPlayer height in display format (e.g. '6-2').
ageInt64Player age (in years).
date_of_birthStringDate of birth (YYYY-MM-DD).
slugStringURL-safe identifier.
jerseyStringJersey number worn by the player.
linkedBooleanTRUE if the record is linked to a related entity.
activeBooleanTRUE if the row represents an active record (player / team / season).
alternate_ids_sdrString
birth_place_cityStringBirth place city.
birth_place_stateStringBirth place state.
birth_place_countryStringBirth place country.
headshot_hrefStringHeadshot image URL.
headshot_altStringAlternative-text label for the headshot.
contracts_hrefString
experience_yearsInt64Experience years.
college_athlete_hrefString
status_idInt64Status identifier.
status_nameStringStatus label.
status_typeStringStatus type.
status_abbreviationStringStatus abbreviation.
position_idInt64ESPN's numeric identifier of the athlete's listed position (the Core v2 position resource id).
position_nameStringName of the athlete's listed position from ESPN's position resource, e.g. Guard or Forward.
position_display_nameStringDisplay form of the athlete's listed position as ESPN renders it; usually equal to position_name.
position_abbreviationStringShort code of the athlete's listed position (e.g. G, F, RW, OL), from ESPN's position resource.
position_leafBooleanWhether the position is a leaf of ESPN's position tree; False marks a grouping, not a specific role.
draft_display_textStringDraft display text.
draft_roundInt64Round of the draft selection.
draft_yearInt64Draft year (4-digit).
draft_selectionInt64Draft selection.
draft_team_hrefString
citizenshipStringCitizenship.
hand_typeStringHand type.
hand_abbreviationStringHand abbreviation.
hand_display_valueStringHand display value.
starterBooleanTRUE if the player was in the starting lineup; FALSE otherwise.
jersey_rightString
validBooleanValid.
did_not_playBooleanTRUE if the player did not appear in the game.
display_nameStringDisplay name.
reasonStringReason.
ejectedBooleanTRUE if the player was ejected from the game.
athlete_hrefString
position_hrefString
statistics_hrefString
team_idInt64Unique team identifier.
orderInt64Display order within the result set.
home_awayStringGame venue label ('home' or 'away').
winnerBooleanWinner.
team_guidStringESPN team GUID.
team_uidStringESPN universal team identifier (UID format 's:40~l:...~t:...').
team_slugStringURL-safe team identifier (e.g. 'lasvegas-aces' / 'aces').
team_locationStringTeam city or location string.
team_nameStringFull team display name (e.g. 'Las Vegas Aces').
team_abbreviationStringShort team abbreviation (e.g. 'LAS').
team_display_nameStringFull team display name.
team_short_display_nameStringShort team display name (e.g. 'Aces').
team_colorStringTeam primary color (hex without leading '#').
team_alternate_colorStringTeam alternate color (hex without leading '#').
is_activeBooleanWhether the team was active in this season.
is_all_starBooleanIs all star.
team_alternate_ids_sdrString
logo_hrefStringTeam or league logo URL.
logo_dark_hrefStringLogo URL for dark backgrounds.
game_idInt64Unique game identifier.

Raises

ExceptionDescription
NoDataErrorESPN has no competitors, roster or athlete resource for the game (404), or every rostered athlete's $ref answered 404. A single 404 athlete is left out with a UserWarning and the rest of the roster is returned.
AssetFetchErrorA fetch failed (403, 429, 5xx, a dropped connection); never treated as a missing athlete.

Example

from sportsdataverse.wnba import espn_wnba_game_rosters
rosters = espn_wnba_game_rosters(game_id=401620238) # MIN at CON, 2024-05-23
print(rosters.shape)
rosters.select(["athlete_display_name", "jersey", "team_abbreviation", "starter"]).head(10)

# Just the starters

import polars as pl
rosters.filter(pl.col("starter") == True).select(["athlete_display_name", "team_abbreviation"])

# Pandas round-trip

rosters_pd = espn_wnba_game_rosters(game_id=401620238, return_as_pandas=True)
rosters_pd[["athlete_display_name", "team_abbreviation", "did_not_play"]].head()

espn_wnba_pbp​

espn_wnba_pbp(game_id: 'int', raw: 'bool' = False, return_parsed: 'bool' = True, return_as_pandas: 'bool' = False, **kwargs)

espn_wnba_pbp() - Pull one game's play-by-play from ESPN's wnba/summary endpoint.

By default the plays come back as the frame the espn_wnba_pbp release publishes (what ~sportsdataverse.wnba.load_wnba_pbp reads): snake_case columns, Int32 team / athlete / game ids, the Int64 play id, sub-second Float64 clocks, game_date / game_date_time, the wehoop shot coordinates, athlete_name_{1,2,3}, and home_score / away_score rebuilt from the scoring plays when that reproduces the final (score_source says which).

Parameters

ParameterTypeDefaultDescription
game_idintUnique game_id, can be obtained from wnba_schedule().
rawboolFalseIf True, returns the raw json from the API endpoint (wins over return_parsed).
return_parsedboolTrueIf True (default), returns the release play-by-play frame. If False, returns the game dictionary (the shape before 0.2.0, which helper_wnba_play_by_play / helper_wnba_team_box / helper_wnba_player_box and game_page_frames read).
return_as_pandasboolFalseIf True, returns the frame as pandas instead of polars. Ignored with raw=True or return_parsed=False, which return a dict.

Returns

One row per play, columns (in order) and dtypes as the release (load_wnba_pbp) for that season; a pandas frame with return_as_pandas=True. Zero rows, with the release's columns, when ESPN has no play-by-play for the game (playByPlaySource == "none") or 10 or fewer plays (wehoop returns NULL). A game with no betting line has null spread, home-favorite and home-team-spread values on every play and the spread-available flag False, never a default line. With return_parsed=False, a dictionary of game data with keys: "gameId", "plays", "winprobability", "boxscore", "header", "format", "broadcasts", "videos", "playByPlaySource", "standings", "article", "leaders", "seasonseries", "timeouts", "pickcenter", "againstTheSpread", "odds", "predictor", "espnWP", "gameInfo", "teamInfo", "season".

Example

from sportsdataverse.wnba import espn_wnba_pbp
plays = espn_wnba_pbp(game_id=401620238) # MIN at CON, 2024-05-23
print(plays.shape)
print(plays.select(["period_number", "clock_display_value", "type_text", "text"]).head(5))

# As pandas

plays_pd = espn_wnba_pbp(game_id=401620238, return_as_pandas=True)

# The game dictionary (box score, header, pickcenter, ...)

game = espn_wnba_pbp(game_id=401620238, return_parsed=False)
list(game.keys()) # ['gameId', 'plays', 'winprobability', ...]

# Fetch the unparsed payload for custom downstream parsing

raw = espn_wnba_pbp(game_id=401620238, raw=True)
sorted(raw.keys())[:5] # raw ESPN summary keys, no flattening

espn_wnba_player_stats​

espn_wnba_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 WNBA 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, the athlete / team metadata blocks, and the season_type / total parameters.

Parameters

ParameterTypeDefaultDescription
athlete_idintESPN WNBA athlete identifier (e.g. 3149391 for A'ja Wilson).
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. See sportsdataverse.wbb.espn_wbb_player_stats for the column layout.

col_nametypedescription
seasonInt64Season as a 4-digit starting year (integer). A 'YYYY-YY' string is not accepted.
season_typeStringSeason type (1=pre-season, 2=regular season, 3=postseason, 4=off-season for ESPN; or string label for WNBA Stats).
totalBooleanTotal.
athlete_idInt64Unique athlete identifier (ESPN).
athlete_uidStringESPN athlete UID (universal identifier).
athlete_guidStringESPN athlete GUID.
athlete_typeStringAthlete type / class.
first_nameStringPlayer's first name.
last_nameStringPlayer's last name.
full_nameStringPlayer's full name.
display_nameStringDisplay name.
short_nameStringShort display name.
weightFloat64Player weight in pounds.
display_weightStringPlayer weight in display format (e.g. '180 lbs').
heightFloat64Player height (string e.g. '6-2' or inches).
display_heightStringPlayer height in display format (e.g. '6-2').
ageInt64Player age (in years).
date_of_birthStringDate of birth (YYYY-MM-DD).
jerseyStringJersey number worn by the player.
slugStringURL-safe identifier.
activeBooleanTRUE if the row represents an active record (player / team / season).
position_idInt64Unique position identifier.
position_nameStringListed roster position ('Guard', 'Forward', 'Center').
position_display_nameStringPosition display name.
position_abbreviationStringPosition abbreviation ('G' / 'F' / 'C').
college_nameStringCollege name.
status_idInt64Status identifier.
status_nameStringStatus label.
defensive_blocksFloat64Short for blocked shot, number of times when a defensive player legally deflects a field goal attempt from an offensive player.
defensive_defensive_reboundsFloat64The number of times when the defense obtains the possession of the ball after a missed shot by the offense.
defensive_stealsFloat64The number of times a defensive player forced a turnover by intercepting or deflecting a pass or a dribble of an offensive player.
defensive_avg_defensive_reboundsFloat64The average defensive rebounds per game.
defensive_avg_blocksFloat64The average blocks per game.
defensive_avg_stealsFloat64The average steals per game.
defensive_avg48_defensive_reboundsFloat64Player's defensive rebounds per 48 minutes of play, drawn from the defensive statistical category.
defensive_avg48_blocksFloat64Player's blocked shots per 48 minutes of play, drawn from the defensive statistical category.
defensive_avg48_stealsFloat64Player's steals per 48 minutes of play, drawn from the defensive statistical category.
general_disqualificationsFloat64The number of times a player reached the foul limit.
general_flagrant_foulsFloat64The number of fouls that the officials thought were unnecessary or excessive.
general_foulsFloat64The number of times a player had illegal contact with the opponent.
general_ejectionsFloat64The number of times a player or coach is removed from the game as a result of a serious offense.
general_technical_foulsFloat64The number of times an player or coach was called for a technical foul (unsportsmanlike conduct or violations).
general_reboundsFloat64The total number of rebounds (offensive and defensive).
general_vorpFloat64Value Over Replacement Player.
general_minutesFloat64The total number of minutes played.
general_avg_minutesFloat64The average number of minutes per game.
general_fantasy_ratingFloat64The Fantasy Rating of a player.
general_nba_ratingFloat64General nba rating.
general_plus_minusFloat64A player's estimated on-court impact on team performance measured in point differential per 100 possessions.
general_avg_reboundsFloat64The average rebounds per game.
general_avg_foulsFloat64The average fouls committed per game.
general_avg_flagrant_foulsFloat64The average number of flagrant fouls per game.
general_avg_technical_foulsFloat64The average number of technical fouls per game.
general_avg_ejectionsFloat64The average ejections per game.
general_avg_disqualificationsFloat64The average number of disqualifications per game.
general_assist_turnover_ratioFloat64The average number of assists a player or team records per turnover.
general_steal_foul_ratioFloat64The average number of steals a player or team records per foul committed.
general_block_foul_ratioFloat64The average number of blocks a player or record per foul committed.
general_avg_team_reboundsFloat64The average number of rebounds for a team per game.
general_total_reboundsFloat64The total number of rebounds for a team or player.
general_total_technical_foulsFloat64The total number of technical fouls for a team or player.
general_team_assist_turnover_ratioFloat64The number of assists per turnover for a team.
general_steal_turnover_ratioFloat64The number of steals per turnover.
general_avg48_reboundsFloat64Player's total rebounds (offensive plus defensive) per 48 minutes of play, drawn from the general statistical category.
general_avg48_foulsFloat64Player's personal fouls per 48 minutes of play, drawn from the general statistical category.
general_avg48_flagrant_foulsFloat64Player's flagrant fouls per 48 minutes of play, drawn from the general statistical category.
general_avg48_technical_foulsFloat64Player's technical fouls per 48 minutes of play, drawn from the general statistical category.
general_avg48_ejectionsFloat64Player's ejections per 48 minutes of play, drawn from the general statistical category.
general_avg48_disqualificationsFloat64Player's disqualifications (fouling out) per 48 minutes of play, drawn from the general statistical category.
general_games_playedFloat64Games Played.
general_games_startedFloat64The number of games started by an athlete.
general_double_doubleFloat64The number of times double digit values were accumulated in 2 of the following categories: points, rebounds, assists, steals, and blocked shots.
general_triple_doubleFloat64The number of times double digit values were accumulated in 3 of the following categories: points, rebounds, assists, steals, and blocked shots.
offensive_assistsFloat64The number of times a player who passes the ball to a teammate in a way that leads to a score by field goal, meaning that he or she was "assisting" in the basket. There is some judgment involved in deciding whether a passer should be credited with an assist.
offensive_field_goalsFloat64Field Goal makes and attempts.
offensive_field_goals_attemptedFloat64The number of times a 2pt field goal was attempted.
offensive_field_goals_madeFloat64The number of times a 2pt field goal was made.
offensive_field_goal_pctFloat64The ratio of field goals made to field goals attempted: FGM / FGA.
offensive_free_throwsFloat64Free Throw makes and attempts.
offensive_free_throw_pctFloat64The ratio of free throws made to free throws attempted: FTM / FTA.
offensive_free_throws_attemptedFloat64The number of times a free throw was attempted.
offensive_free_throws_madeFloat64The number of times a free throw was made.
offensive_offensive_reboundsFloat64The number of times when the offense obtains the possession of the ball after a missed shot.
offensive_pointsFloat64The number of points scored.
offensive_turnoversFloat64The number of times a player loses possession to the other team.
offensive_three_point_pctFloat64The ratio of 3pt field goals made to 3pt field goals attempted: 3PM / 3PA.
offensive_three_point_field_goals_attemptedFloat64The number of times a 3pt field goal was attempted.
offensive_three_point_field_goals_madeFloat64The number of times a 3pt field goal was made.
offensive_total_turnoversFloat64The number of turnovers plus team turnovers for the team.
offensive_points_in_paintFloat64The amount of points scored in the area known as "the Paint"(the rectangle between the foul line and the baseline).
offensive_brick_indexFloat64How many points a player costs his team with his shooting compared with the league average on a per-40-minute basis. ((52.8 - TS%) x (FGA + (FTA x 0.44))) / (Min/40) .
offensive_avg_field_goals_madeFloat64The average field goals made per game.
offensive_avg_field_goals_attemptedFloat64The average field goals attempted per game.
offensive_avg_three_point_field_goals_madeFloat64The average three point field goals made per game.
offensive_avg_three_point_field_goals_attemptedFloat64The average three point field goals attempted per game.
offensive_avg_free_throws_madeFloat64The average free throw shots made per game.
offensive_avg_free_throws_attemptedFloat64The average free throw shots attempted per game.
offensive_avg_pointsFloat64The average number of points scored per game.
offensive_avg_offensive_reboundsFloat64The average offensive rebounds per game.
offensive_avg_assistsFloat64The average assists per game.
offensive_avg_turnoversFloat64The average turnovers committed per game.
offensive_offensive_rebound_pctFloat64The percentage of the number of times they obtain the possession of the ball after a missed shot.
offensive_estimated_possessionsFloat64An estimation of the number of possessions for a team or player.
offensive_avg_estimated_possessionsFloat64The average number of estimated possessions per game for a team or player.
offensive_points_per_estimated_possessionsFloat64The number of points per estimated possession for a team or player.
offensive_avg_team_turnoversFloat64The average number of turnovers for a team per game.
offensive_avg_total_turnoversFloat64The average number of total turnovers for a team per game.
offensive_three_point_field_goal_pctFloat64The ratio of 3pt field goals made to 3pt field goals attempted: 3PM / 3PA.
offensive_two_point_field_goals_madeFloat64The number of 2-point field goals made for a team or player.
offensive_two_point_field_goals_attemptedFloat64The number of 2-point field goals attempted for a team or player.
offensive_avg_two_point_field_goals_madeFloat64The number of 2-point field goals made per game for a team or player.
offensive_avg_two_point_field_goals_attemptedFloat64The number of 2-point field goals attempted per game for a team or player.
offensive_two_point_field_goal_pctFloat64The percentage of 2-points fields goals made by a team or player.
offensive_shooting_efficiencyFloat64The efficiency with which a team or player shoots the basketball.
offensive_scoring_efficiencyFloat64The efficiency with which a team or player scores the basketball.
offensive_avg48_field_goals_madeFloat64Player's field goals made per 48 minutes of play, drawn from the offensive statistical category.
offensive_avg48_field_goals_attemptedFloat64Player's field goal attempts per 48 minutes of play, drawn from the offensive statistical category.
offensive_avg48_three_point_field_goals_madeFloat64Player's three-point field goals made per 48 minutes of play, drawn from the offensive statistical category.
offensive_avg48_three_point_field_goals_attemptedFloat64Player's three-point field goal attempts per 48 minutes of play, drawn from the offensive statistical category.
offensive_avg48_free_throws_madeFloat64Player's free throws made per 48 minutes of play, drawn from the offensive statistical category.
offensive_avg48_free_throws_attemptedFloat64Player's free throw attempts per 48 minutes of play, drawn from the offensive statistical category.
offensive_avg48_pointsFloat64Player's points scored per 48 minutes of play, drawn from the offensive statistical category.
offensive_avg48_offensive_reboundsFloat64Player's offensive rebounds per 48 minutes of play, drawn from the offensive statistical category.
offensive_avg48_assistsFloat64Player's assists per 48 minutes of play, drawn from the offensive statistical category.
offensive_avg48_turnoversFloat64Player's turnovers per 48 minutes of play, drawn from the offensive statistical category.
team_idInt64Unique team identifier.
team_uidStringESPN universal team identifier (UID format 's:40~l:...~t:...').
team_guidStringESPN team GUID.
team_slugStringURL-safe team identifier (e.g. 'lasvegas-aces' / 'aces').
team_locationStringTeam city or location string.
team_nameStringFull team display name (e.g. 'Las Vegas Aces').
team_abbreviationStringShort team abbreviation (e.g. 'LAS').
team_display_nameStringFull team display name.
team_short_display_nameStringShort team display name (e.g. 'Aces').
team_colorStringTeam primary color (hex without leading '#').
team_alternate_colorStringTeam alternate color (hex without leading '#').
team_is_activeBooleanTRUE if the team is currently active.
team_logo_hrefString

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.wnba import espn_wnba_player_stats
df = espn_wnba_player_stats(athlete_id=3149391, season=2024)
df.select(["full_name", "team_display_name", "offensive_points"])

espn_wnba_schedule​

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

espn_wnba_schedule - look up the WNBA schedule for a given season

Parameters

ParameterTypeDefaultDescription
datesintNoneUsed to define different seasons. 2002 is the earliest available season.
season_typeintNone2 for regular season, 3 for post-season, 4 for off-season.
limitint500number of records to return, default: 500.
return_as_pandasFalse

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
idInt64Unique play identification number
uidStringESPN UID string.
dateStringDate in YYYY-MM-DD format.
attendanceInt64Reported attendance.
time_validBooleanTime valid.
neutral_siteBooleanNeutral site.
conference_competitionBooleanConference competition.
play_by_play_availableBoolean
recentBooleanRecent.
start_dateStringStart date (YYYY-MM-DD).
broadcastStringBroadcast information string.
highlightsString
notes_typeStringNotes type.
notes_headlineStringNotes headline.
broadcast_marketStringBroadcast market label (e.g. 'national', 'home').
broadcast_nameStringBroadcast name.
type_idInt64Type identifier (numeric).
type_abbreviationStringPlay type abbreviation
venue_idInt64Unique venue identifier.
venue_full_nameStringVenue full name.
venue_address_cityStringVenue address city.
venue_address_stateStringVenue address state / region.
venue_indoorBooleanTRUE if the venue is indoors.
status_clockFloat64Status clock.
status_display_clockStringStatus display clock.
status_periodInt64Status period.
status_type_idInt64Unique identifier for status type.
status_type_nameStringStatus type name.
status_type_stateStringStatus type state.
status_type_completedBooleanStatus type completed.
status_type_descriptionStringStatus type description.
status_type_detailStringStatus type detail.
status_type_short_detailStringStatus type short detail.
format_regulation_periodsInt64Format regulation periods.
home_idInt64Unique identifier for home.
home_uidStringHome team's uid.
home_locationStringHome team's location.
home_nameStringHome name.
home_abbreviationStringHome team's abbreviation.
home_display_nameStringHome display name.
home_short_display_nameStringHome short display name.
home_colorStringColor code (hex) for home.
home_alternate_colorStringColor code (hex) for home alternate.
home_is_activeBooleanHome team's is active.
home_venue_idInt64Unique identifier for home venue.
home_logoStringHome team logo URL.
home_scoreStringHome team score at the time of the play.
home_winnerBooleanHome team's winner.
home_linescoresListPeriod-by-period point totals for the home team, stored as a list of integer scores.
home_recordsStringWin-loss record strings for the home team across relevant splits (e.g., overall, home/away, conference).
away_idInt64Unique identifier for away.
away_uidStringAway team's uid.
away_locationStringAway team's location.
away_nameStringAway name.
away_abbreviationStringAway team's abbreviation.
away_display_nameStringAway display name.
away_short_display_nameStringAway short display name.
away_colorStringColor code (hex) for away.
away_alternate_colorStringColor code (hex) for away alternate.
away_is_activeBooleanAway team's is active.
away_venue_idInt64Unique identifier for away venue.
away_logoStringAway team logo URL.
away_scoreStringAway team score at the time of the play.
away_winnerBooleanAway team's winner.
away_linescoresListPeriod-by-period point totals for the away team, stored as a list of integer scores.
away_recordsStringWin-loss record strings for the away team across relevant splits (e.g., overall, home/away, conference).
game_idInt64Unique game identifier.
seasonInt64Season as a 4-digit starting year (integer). A 'YYYY-YY' string is not accepted.
season_typeInt64Season type (1=pre-season, 2=regular season, 3=postseason, 4=off-season for ESPN; or string label for WNBA Stats).
status_type_alt_detailStringStatus type alt detail.
home_logo_darkString
away_logo_darkString

Example

from sportsdataverse.wnba import espn_wnba_schedule
sched = espn_wnba_schedule(dates=20241011) # 2024 WNBA Finals Game 1
print(sched.shape)
sched.select(["game_id", "home_name", "away_name", "status_type_description"]).head()

# Pull a full regular season's worth of games

reg = espn_wnba_schedule(dates=2024, season_type=2, limit=500)
reg.group_by("status_type_description").len().sort("len", descending=True)

# Pandas round-trip for a single date

espn_wnba_schedule(dates=20241011, return_as_pandas=True).head()

espn_wnba_standings​

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

Pull ESPN WNBA standings for a season.

See sportsdataverse.wbb.espn_wbb_standings for full documentation of the column set. The WNBA endpoint does not take a group filter.

Parameters

ParameterTypeDefaultDescription
seasonintSeason year, forwarded to ESPN as ?season=YYYY.
rawboolFalseIf True, returns the parsed JSON dict before any flattening.
return_as_pandasboolFalseIf True, returns a pandas DataFrame; otherwise polars.

Returns

Polars (or pandas) DataFrame with one row per team — see sportsdataverse.wbb.espn_wbb_standings for the full column list. If raw=True, returns the raw response dict.

col_nametypedescription
team_idInt64Unique team identifier.
team_uidStringESPN universal team identifier (UID format 's:40~l:...~t:...').
team_slugStringURL-safe team identifier (e.g. 'lasvegas-aces' / 'aces').
team_locationStringTeam city or location string.
team_nameStringFull team display name (e.g. 'Las Vegas Aces').
team_abbreviationStringShort team abbreviation (e.g. 'LAS').
team_display_nameStringFull team display name.
team_short_display_nameStringShort team display name (e.g. 'Aces').
team_colorStringTeam primary color (hex without leading '#').
conference_idInt64Conference identifier.
conference_nameStringFull conference name.
conference_abbreviationStringConference abbreviation, E (Eastern) or W (Western).
winsInt64Total wins.
lossesInt64Total losses.
win_percentFloat64Win percent.
games_backFloat64Games behind the conference leader (0 for the leader).
streakStringCurrent streak (e.g. 'W3' for three-game win streak).
points_forFloat64Points for.
points_againstFloat64Points allowed.
point_differentialFloat64Point differential.
avg_points_forFloat64Points the team scored per game.
avg_points_againstFloat64Points the team allowed per game.
home_winsInt64Home team's wins.
home_lossesInt64Home team's losses.
road_winsInt64Road wins.
road_lossesInt64Road losses.
division_winsInt64Wins against division opponents; the WNBA has no divisions, so ESPN sends 0.
division_lossesInt64Losses against division opponents; the WNBA has no divisions, so ESPN sends 0.
seasonInt64Season identifier (4-digit year or 'YYYY-YY' string).

Raises

ExceptionDescription
sportsdataverse.errors.NoDataErrorESPN returned 404.
requests.exceptions.RequestExceptionOther network failures after retries.

Example

from sportsdataverse.wnba import espn_wnba_standings
standings = espn_wnba_standings(season=2024)
print(standings.shape)
standings.head()

# Sort by win percentage

import polars as pl
standings.sort("win_percent", descending=True).select(
["team_display_name", "wins", "losses", "win_percent"]
).head(8)

# Pandas round-trip

standings_pd = espn_wnba_standings(season=2024, return_as_pandas=True)
standings_pd[["team_display_name", "wins", "losses"]].head()

espn_wnba_team_roster​

espn_wnba_team_roster(team_id: 'int', season: 'int | None' = None, *, raw: 'bool' = False, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> 'pl.DataFrame | pd.DataFrame | dict[str, Any]'

Pull the current ESPN team roster for a WNBA team.

See sportsdataverse.wbb.espn_wbb_team_roster for full documentation of the column set. ESPN's /teams/{id}/roster endpoint ignores ?season=YYYY; the season argument is recorded as an output column only and does not alter the request URL.

Parameters

ParameterTypeDefaultDescription
team_idintESPN WNBA team identifier (e.g. 3 for Dallas Wings).
seasonint | NoneNoneSeason year (recorded as output column only).
rawboolFalseIf True, returns the parsed JSON dict before any flattening.
return_as_pandasboolFalseIf True, returns a pandas DataFrame; otherwise polars.

Returns

Polars (or pandas) DataFrame with the same columns documented in sportsdataverse.wbb.espn_wbb_team_roster. If raw=True, returns the raw response dict.

col_nametypedescription
athlete_idStringUnique athlete identifier (ESPN).
athlete_uidStringESPN athlete UID (universal identifier).
first_nameStringPlayer's first name.
last_nameStringPlayer's last name.
full_nameStringPlayer's full name.
display_nameStringDisplay name.
short_nameStringShort display name.
jerseyStringJersey number worn by the player.
position_idStringUnique position identifier.
position_nameStringListed roster position ('Guard', 'Forward', 'Center').
position_abbreviationStringPosition abbreviation ('G' / 'F' / 'C').
heightFloat64Player height (string e.g. '6-2' or inches).
display_heightStringPlayer height in display format (e.g. '6-2').
weightFloat64Player weight in pounds.
display_weightStringPlayer weight in display format (e.g. '180 lbs').
ageInt64Player age (in years).
date_of_birthStringDate of birth (YYYY-MM-DD).
birth_cityStringBirth city.
birth_stateStringBirth state / region.
headshot_hrefStringHeadshot image URL.
link_webStringWeb link / URL.
status_nameStringStatus label.
team_idInt64Unique team identifier.
seasonInt64Season identifier (4-digit year or 'YYYY-YY' string).

Raises

ExceptionDescription
sportsdataverse.errors.NoDataErrorESPN returned 404.
requests.exceptions.RequestExceptionOther network failures after retries.

Example

from sportsdataverse.wnba import espn_wnba_team_roster
roster = espn_wnba_team_roster(team_id=17, season=2024)
print(roster.shape)
roster.select(["athlete_id", "full_name", "jersey", "position_abbreviation"]).head()

# Pandas round-trip — useful for one-off notebook work

roster_pd = espn_wnba_team_roster(team_id=17, season=2024, return_as_pandas=True)
roster_pd[["full_name", "jersey", "position_abbreviation", "height"]].head()

# Inspect the raw ESPN payload

payload = espn_wnba_team_roster(team_id=17, season=2024, raw=True)
list(payload.keys())[:8]

espn_wnba_team_stats​

espn_wnba_team_stats(team_id: 'int', season: 'int', *, raw: 'bool' = False, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> 'dict[str, pl.DataFrame] | dict[str, pd.DataFrame] | dict[str, Any]'

Pull ESPN team season stats for a WNBA team.

See sportsdataverse.wbb.espn_wbb_team_stats for full documentation of the return shape, the canonical three category keys ("Averages", "Totals", "Misc"), the per-category column set, and the "Other" fallback bucket.

Parameters

ParameterTypeDefaultDescription
team_idintESPN WNBA team identifier (e.g. 17 for the Las Vegas Aces).
seasonintSeason year, forwarded to ESPN as ?season=YYYY.
rawboolFalseIf True, returns the parsed JSON dict before any flattening.
return_as_pandasboolFalseIf True, returns a dict of pandas DataFrames; otherwise polars.

Returns

Dict with one DataFrame per stat category — see sportsdataverse.wbb.espn_wbb_team_stats for the full column / key documentation. If raw=True, returns the raw response dict.

Raises

ExceptionDescription
sportsdataverse.errors.NoDataErrorESPN returned 404.
requests.exceptions.RequestExceptionOther network failures after retries.

Example

from sportsdataverse.wnba import espn_wnba_team_stats
frames = espn_wnba_team_stats(team_id=17, season=2024)
sorted(frames.keys()) # 'Averages', 'Totals', 'Misc' (plus optional 'Other')
frames["Averages"].head()

# Compare per-game and totals at a glance

avgs = frames["Averages"]
totals = frames["Totals"]
print(avgs.shape, totals.shape)
avgs.select(["games_played", "points_per_game", "rebounds_per_game"])

# Pandas round-trip

frames_pd = espn_wnba_team_stats(team_id=17, season=2024, return_as_pandas=True)
frames_pd["Misc"].head()

espn_wnba_teams​

espn_wnba_teams(return_as_pandas=False, **kwargs) -> 'pl.DataFrame'

espn_wnba_teams - look up WNBA teams

Parameters

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

Returns

Polars dataframe of the WNBA teams, one row per team, with the columns in the returns table. A payload without teams returns a zero-row frame with those columns. The result is not cached: every call fetches (through the package's opt-in TTL response cache, sportsdataverse.cache, when it is on).

col_nametypedescription
team_abbreviationStringShort team abbreviation (e.g. 'LAS').
team_alternate_colorStringTeam alternate color (hex without leading '#').
team_colorStringTeam primary color (hex without leading '#').
team_display_nameStringFull team display name.
team_idInt64Unique team identifier.
team_is_activeBooleanTRUE if the team is currently active.
team_is_all_starBooleanTRUE if the row represents an All-Star team.
team_locationStringTeam city or location string.
team_logosInt64
team_nameStringFull team display name (e.g. 'Las Vegas Aces').
team_nicknameStringTeam nickname.
team_short_display_nameStringShort team display name (e.g. 'Aces').
team_slugStringURL-safe team identifier (e.g. 'lasvegas-aces' / 'aces').
team_uidStringESPN universal team identifier (UID format 's:40~l:...~t:...').

Raises

ExceptionDescription
NoDataErrorESPN answered 404 for the teams resource.
AssetFetchErrorThe fetch failed (403, 429, 5xx, a dropped connection); never returned as an empty frame.

Example

from sportsdataverse.wnba import espn_wnba_teams
teams = espn_wnba_teams()
print(teams.shape)
teams.select(["team_id", "team_abbreviation", "team_display_name"]).head()

# Find Las Vegas Aces (team_id 17)

teams.filter(__import__("polars").col("team_id") == 17).to_dicts()

# Pandas round-trip

teams_pd = espn_wnba_teams(return_as_pandas=True)

scoreboard_event_parsing​

scoreboard_event_parsing(event)

Flatten one ESPN scoreboard event for the schedule frame, in place.

Parameters

ParameterTypeDefaultDescription
eventOne element of the scoreboard payload's events list.

Returns

The same event, modified: competitions[0] gains home / away team dicts (with score, winner, currentRank, linescores, records), notes_type / notes_headline and broadcast_market / broadcast_name, and loses competitors, broadcasts, notes, odds, leaders and the other nested blocks the schedule frame does not use.