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
| Parameter | Type | Default | Description |
|---|---|---|---|
season | int | None | Used to define different seasons. 2002 is the earliest available season. |
ondays | boolean | None | Used to return dates for calendar ondays |
return_as_pandas | False |
Returns
Polars dataframe containing calendar dates for the requested season.
| col_name | type | description |
|---|---|---|
season | Int64 | Season identifier (4-digit year or 'YYYY-YY' string). |
datetime | String | The calendar day as ESPN sends it, an ISO 8601 UTC timestamp string. |
date | String | Date in YYYY-MM-DD format. |
year | String | 4-digit year. |
month | String | Month of the calendar day as a two-digit string. |
day | String | Day number within the month. |
dateURL | String | The calendar day as YYYYMMDD, the dates= value of that day's scoreboard request. |
url | String | RotoWire player page URL. |
Raises
| Exception | Description |
|---|---|
ValueError | If 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
| Parameter | Type | Default | Description |
|---|---|---|---|
season | int | Season year (e.g. 2024 for the 2024 WNBA Draft). Forwarded to ESPN as ?season=YYYY. | |
raw | bool | False | If True, returns the parsed JSON dict before any flattening. |
return_as_pandas | bool | False | If 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_name | type | description |
|---|---|---|
season | Int64 | Season identifier (4-digit year or 'YYYY-YY' string). |
round_number | Int64 | Numeric round. |
pick_number | Int64 | Pick number. |
overall_pick | Int64 | Overall pick. |
team_id | Int64 | Unique team identifier. |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_display_name | String | Full team display name. |
athlete_id | Int64 | Unique athlete identifier (ESPN). |
athlete_first_name | String | Drafted player's first name; null when ESPN's draft feed omits it (display_name carries the name). |
athlete_last_name | String | Drafted player's last name; null when ESPN's draft feed omits it. |
athlete_full_name | String | Drafted player's full name; null when ESPN's draft feed omits it. |
athlete_display_name | String | Athlete display name (full). |
athlete_position_id | Int64 | ESPN position id of the drafted player. |
athlete_position_name | String | Athlete position ('Guard', 'Forward', 'Center'). |
athlete_position_abbreviation | String | Athlete position abbreviation (G / F / C). |
athlete_height | String | Drafted player's height as display text, e.g. 6'0". |
athlete_weight | Float64 | Drafted player's weight in pounds; null when ESPN does not list it. |
athlete_age | Int64 | Drafted player's age at the draft; null when ESPN does not list it. |
athlete_birth_city | String | Drafted player's birth city; null when ESPN does not list it. |
athlete_birth_state | String | Drafted player's birth state; null when ESPN does not list it. |
headshot_href | String | Headshot image URL. |
school_id | Int64 | High school / club id. |
school_name | String | Name of the player's school or club before the draft, e.g. Huskies, or a country for an international pick. |
school_abbreviation | String | Abbreviation of that school or club, e.g. CONN or ND. |
link_web | String | Web link / URL. |
Raises
| Exception | Description |
|---|---|
sportsdataverse.errors.NoDataError | ESPN returned 404. |
requests.exceptions.RequestException | Other 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
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int | ESPN WNBA event identifier (e.g. 401620238, Minnesota at Connecticut, 2024-05-23). | |
season | int | None | None | Season year (recorded as output column only). |
raw | bool | False | If True, returns the parsed JSON dict before any flattening. |
return_as_pandas | bool | False | If 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_name | type | description |
|---|---|---|
game_id | Int64 | Unique game identifier. |
season | Int64 | Season as a 4-digit starting year (integer). A 'YYYY-YY' string is not accepted. |
official_id | String | Unique official / referee identifier. |
first_name | String | Player's first name. |
last_name | String | Player's last name. |
full_name | String | Player's full name. |
display_name | String | Display name. |
position_id | String | Unique position identifier. |
position_name | String | Listed roster position ('Guard', 'Forward', 'Center'). |
position_display_name | String | Position display name. |
order | Int64 | Display order within the result set. |
Raises
| Exception | Description |
|---|---|
sportsdataverse.errors.NoDataError | ESPN returned 404. |
requests.exceptions.RequestException | Other 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
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int | Unique game_id, can be obtained from espn_wnba_schedule(). | |
raw | bool | False | If True, returns the Core v2 competitors payload (dict) as ESPN sent it; its roster, team and athlete $ref links are not followed. |
return_as_pandas | bool | False | If 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_name | type | description |
|---|---|---|
athlete_id | Int64 | Unique athlete identifier (ESPN). |
athlete_uid | String | ESPN athlete UID (universal identifier). |
athlete_guid | String | ESPN athlete GUID. |
athlete_type | String | Athlete type / class. |
first_name | String | Player's first name. |
last_name | String | Player's last name. |
full_name | String | Player's full name. |
athlete_display_name | String | Athlete display name (full). |
short_name | String | Short display name. |
weight | Float64 | Player weight in pounds. |
display_weight | String | Player weight in display format (e.g. '180 lbs'). |
height | Float64 | Player height (string e.g. '6-2' or inches). |
display_height | String | Player height in display format (e.g. '6-2'). |
age | Int64 | Player age (in years). |
date_of_birth | String | Date of birth (YYYY-MM-DD). |
slug | String | URL-safe identifier. |
jersey | String | Jersey number worn by the player. |
linked | Boolean | TRUE if the record is linked to a related entity. |
active | Boolean | TRUE if the row represents an active record (player / team / season). |
alternate_ids_sdr | String | |
birth_place_city | String | Birth place city. |
birth_place_state | String | Birth place state. |
birth_place_country | String | Birth place country. |
headshot_href | String | Headshot image URL. |
headshot_alt | String | Alternative-text label for the headshot. |
contracts_href | String | |
experience_years | Int64 | Experience years. |
college_athlete_href | String | |
status_id | Int64 | Status identifier. |
status_name | String | Status label. |
status_type | String | Status type. |
status_abbreviation | String | Status abbreviation. |
position_id | Int64 | ESPN's numeric identifier of the athlete's listed position (the Core v2 position resource id). |
position_name | String | Name of the athlete's listed position from ESPN's position resource, e.g. Guard or Forward. |
position_display_name | String | Display form of the athlete's listed position as ESPN renders it; usually equal to position_name. |
position_abbreviation | String | Short code of the athlete's listed position (e.g. G, F, RW, OL), from ESPN's position resource. |
position_leaf | Boolean | Whether the position is a leaf of ESPN's position tree; False marks a grouping, not a specific role. |
draft_display_text | String | Draft display text. |
draft_round | Int64 | Round of the draft selection. |
draft_year | Int64 | Draft year (4-digit). |
draft_selection | Int64 | Draft selection. |
draft_team_href | String | |
citizenship | String | Citizenship. |
hand_type | String | Hand type. |
hand_abbreviation | String | Hand abbreviation. |
hand_display_value | String | Hand display value. |
starter | Boolean | TRUE if the player was in the starting lineup; FALSE otherwise. |
jersey_right | String | |
valid | Boolean | Valid. |
did_not_play | Boolean | TRUE if the player did not appear in the game. |
display_name | String | Display name. |
reason | String | Reason. |
ejected | Boolean | TRUE if the player was ejected from the game. |
athlete_href | String | |
position_href | String | |
statistics_href | String | |
team_id | Int64 | Unique team identifier. |
order | Int64 | Display order within the result set. |
home_away | String | Game venue label ('home' or 'away'). |
winner | Boolean | Winner. |
team_guid | String | ESPN team GUID. |
team_uid | String | ESPN universal team identifier (UID format 's:40~l:...~t:...'). |
team_slug | String | URL-safe team identifier (e.g. 'lasvegas-aces' / 'aces'). |
team_location | String | Team city or location string. |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_display_name | String | Full team display name. |
team_short_display_name | String | Short team display name (e.g. 'Aces'). |
team_color | String | Team primary color (hex without leading '#'). |
team_alternate_color | String | Team alternate color (hex without leading '#'). |
is_active | Boolean | Whether the team was active in this season. |
is_all_star | Boolean | Is all star. |
team_alternate_ids_sdr | String | |
logo_href | String | Team or league logo URL. |
logo_dark_href | String | Logo URL for dark backgrounds. |
game_id | Int64 | Unique game identifier. |
Raises
| Exception | Description |
|---|---|
NoDataError | ESPN 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. |
AssetFetchError | A 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
| Parameter | Type | Default | Description |
|---|---|---|---|
game_id | int | Unique game_id, can be obtained from wnba_schedule(). | |
raw | bool | False | If True, returns the raw json from the API endpoint (wins over return_parsed). |
return_parsed | bool | True | If 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_pandas | bool | False | If 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
| Parameter | Type | Default | Description |
|---|---|---|---|
athlete_id | int | ESPN WNBA athlete identifier (e.g. 3149391 for A'ja Wilson). | |
season | int | Season year, used in the core-v2 path. | |
season_type | str | 'regular' | "regular" (type 2) or "postseason" (type 3). |
total | bool | False | Forward-compat totals passthrough. |
raw | bool | False | If True, returns the raw core-v2 statistics JSON dict. |
return_as_pandas | bool | False | If 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_name | type | description |
|---|---|---|
season | Int64 | Season as a 4-digit starting year (integer). A 'YYYY-YY' string is not accepted. |
season_type | String | Season type (1=pre-season, 2=regular season, 3=postseason, 4=off-season for ESPN; or string label for WNBA Stats). |
total | Boolean | Total. |
athlete_id | Int64 | Unique athlete identifier (ESPN). |
athlete_uid | String | ESPN athlete UID (universal identifier). |
athlete_guid | String | ESPN athlete GUID. |
athlete_type | String | Athlete type / class. |
first_name | String | Player's first name. |
last_name | String | Player's last name. |
full_name | String | Player's full name. |
display_name | String | Display name. |
short_name | String | Short display name. |
weight | Float64 | Player weight in pounds. |
display_weight | String | Player weight in display format (e.g. '180 lbs'). |
height | Float64 | Player height (string e.g. '6-2' or inches). |
display_height | String | Player height in display format (e.g. '6-2'). |
age | Int64 | Player age (in years). |
date_of_birth | String | Date of birth (YYYY-MM-DD). |
jersey | String | Jersey number worn by the player. |
slug | String | URL-safe identifier. |
active | Boolean | TRUE if the row represents an active record (player / team / season). |
position_id | Int64 | Unique position identifier. |
position_name | String | Listed roster position ('Guard', 'Forward', 'Center'). |
position_display_name | String | Position display name. |
position_abbreviation | String | Position abbreviation ('G' / 'F' / 'C'). |
college_name | String | College name. |
status_id | Int64 | Status identifier. |
status_name | String | Status label. |
defensive_blocks | Float64 | Short for blocked shot, number of times when a defensive player legally deflects a field goal attempt from an offensive player. |
defensive_defensive_rebounds | Float64 | The number of times when the defense obtains the possession of the ball after a missed shot by the offense. |
defensive_steals | Float64 | The 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_rebounds | Float64 | The average defensive rebounds per game. |
defensive_avg_blocks | Float64 | The average blocks per game. |
defensive_avg_steals | Float64 | The average steals per game. |
defensive_avg48_defensive_rebounds | Float64 | Player's defensive rebounds per 48 minutes of play, drawn from the defensive statistical category. |
defensive_avg48_blocks | Float64 | Player's blocked shots per 48 minutes of play, drawn from the defensive statistical category. |
defensive_avg48_steals | Float64 | Player's steals per 48 minutes of play, drawn from the defensive statistical category. |
general_disqualifications | Float64 | The number of times a player reached the foul limit. |
general_flagrant_fouls | Float64 | The number of fouls that the officials thought were unnecessary or excessive. |
general_fouls | Float64 | The number of times a player had illegal contact with the opponent. |
general_ejections | Float64 | The number of times a player or coach is removed from the game as a result of a serious offense. |
general_technical_fouls | Float64 | The number of times an player or coach was called for a technical foul (unsportsmanlike conduct or violations). |
general_rebounds | Float64 | The total number of rebounds (offensive and defensive). |
general_vorp | Float64 | Value Over Replacement Player. |
general_minutes | Float64 | The total number of minutes played. |
general_avg_minutes | Float64 | The average number of minutes per game. |
general_fantasy_rating | Float64 | The Fantasy Rating of a player. |
general_nba_rating | Float64 | General nba rating. |
general_plus_minus | Float64 | A player's estimated on-court impact on team performance measured in point differential per 100 possessions. |
general_avg_rebounds | Float64 | The average rebounds per game. |
general_avg_fouls | Float64 | The average fouls committed per game. |
general_avg_flagrant_fouls | Float64 | The average number of flagrant fouls per game. |
general_avg_technical_fouls | Float64 | The average number of technical fouls per game. |
general_avg_ejections | Float64 | The average ejections per game. |
general_avg_disqualifications | Float64 | The average number of disqualifications per game. |
general_assist_turnover_ratio | Float64 | The average number of assists a player or team records per turnover. |
general_steal_foul_ratio | Float64 | The average number of steals a player or team records per foul committed. |
general_block_foul_ratio | Float64 | The average number of blocks a player or record per foul committed. |
general_avg_team_rebounds | Float64 | The average number of rebounds for a team per game. |
general_total_rebounds | Float64 | The total number of rebounds for a team or player. |
general_total_technical_fouls | Float64 | The total number of technical fouls for a team or player. |
general_team_assist_turnover_ratio | Float64 | The number of assists per turnover for a team. |
general_steal_turnover_ratio | Float64 | The number of steals per turnover. |
general_avg48_rebounds | Float64 | Player's total rebounds (offensive plus defensive) per 48 minutes of play, drawn from the general statistical category. |
general_avg48_fouls | Float64 | Player's personal fouls per 48 minutes of play, drawn from the general statistical category. |
general_avg48_flagrant_fouls | Float64 | Player's flagrant fouls per 48 minutes of play, drawn from the general statistical category. |
general_avg48_technical_fouls | Float64 | Player's technical fouls per 48 minutes of play, drawn from the general statistical category. |
general_avg48_ejections | Float64 | Player's ejections per 48 minutes of play, drawn from the general statistical category. |
general_avg48_disqualifications | Float64 | Player's disqualifications (fouling out) per 48 minutes of play, drawn from the general statistical category. |
general_games_played | Float64 | Games Played. |
general_games_started | Float64 | The number of games started by an athlete. |
general_double_double | Float64 | The number of times double digit values were accumulated in 2 of the following categories: points, rebounds, assists, steals, and blocked shots. |
general_triple_double | Float64 | The number of times double digit values were accumulated in 3 of the following categories: points, rebounds, assists, steals, and blocked shots. |
offensive_assists | Float64 | The 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_goals | Float64 | Field Goal makes and attempts. |
offensive_field_goals_attempted | Float64 | The number of times a 2pt field goal was attempted. |
offensive_field_goals_made | Float64 | The number of times a 2pt field goal was made. |
offensive_field_goal_pct | Float64 | The ratio of field goals made to field goals attempted: FGM / FGA. |
offensive_free_throws | Float64 | Free Throw makes and attempts. |
offensive_free_throw_pct | Float64 | The ratio of free throws made to free throws attempted: FTM / FTA. |
offensive_free_throws_attempted | Float64 | The number of times a free throw was attempted. |
offensive_free_throws_made | Float64 | The number of times a free throw was made. |
offensive_offensive_rebounds | Float64 | The number of times when the offense obtains the possession of the ball after a missed shot. |
offensive_points | Float64 | The number of points scored. |
offensive_turnovers | Float64 | The number of times a player loses possession to the other team. |
offensive_three_point_pct | Float64 | The ratio of 3pt field goals made to 3pt field goals attempted: 3PM / 3PA. |
offensive_three_point_field_goals_attempted | Float64 | The number of times a 3pt field goal was attempted. |
offensive_three_point_field_goals_made | Float64 | The number of times a 3pt field goal was made. |
offensive_total_turnovers | Float64 | The number of turnovers plus team turnovers for the team. |
offensive_points_in_paint | Float64 | The amount of points scored in the area known as "the Paint"(the rectangle between the foul line and the baseline). |
offensive_brick_index | Float64 | How 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_made | Float64 | The average field goals made per game. |
offensive_avg_field_goals_attempted | Float64 | The average field goals attempted per game. |
offensive_avg_three_point_field_goals_made | Float64 | The average three point field goals made per game. |
offensive_avg_three_point_field_goals_attempted | Float64 | The average three point field goals attempted per game. |
offensive_avg_free_throws_made | Float64 | The average free throw shots made per game. |
offensive_avg_free_throws_attempted | Float64 | The average free throw shots attempted per game. |
offensive_avg_points | Float64 | The average number of points scored per game. |
offensive_avg_offensive_rebounds | Float64 | The average offensive rebounds per game. |
offensive_avg_assists | Float64 | The average assists per game. |
offensive_avg_turnovers | Float64 | The average turnovers committed per game. |
offensive_offensive_rebound_pct | Float64 | The percentage of the number of times they obtain the possession of the ball after a missed shot. |
offensive_estimated_possessions | Float64 | An estimation of the number of possessions for a team or player. |
offensive_avg_estimated_possessions | Float64 | The average number of estimated possessions per game for a team or player. |
offensive_points_per_estimated_possessions | Float64 | The number of points per estimated possession for a team or player. |
offensive_avg_team_turnovers | Float64 | The average number of turnovers for a team per game. |
offensive_avg_total_turnovers | Float64 | The average number of total turnovers for a team per game. |
offensive_three_point_field_goal_pct | Float64 | The ratio of 3pt field goals made to 3pt field goals attempted: 3PM / 3PA. |
offensive_two_point_field_goals_made | Float64 | The number of 2-point field goals made for a team or player. |
offensive_two_point_field_goals_attempted | Float64 | The number of 2-point field goals attempted for a team or player. |
offensive_avg_two_point_field_goals_made | Float64 | The number of 2-point field goals made per game for a team or player. |
offensive_avg_two_point_field_goals_attempted | Float64 | The number of 2-point field goals attempted per game for a team or player. |
offensive_two_point_field_goal_pct | Float64 | The percentage of 2-points fields goals made by a team or player. |
offensive_shooting_efficiency | Float64 | The efficiency with which a team or player shoots the basketball. |
offensive_scoring_efficiency | Float64 | The efficiency with which a team or player scores the basketball. |
offensive_avg48_field_goals_made | Float64 | Player's field goals made per 48 minutes of play, drawn from the offensive statistical category. |
offensive_avg48_field_goals_attempted | Float64 | Player's field goal attempts per 48 minutes of play, drawn from the offensive statistical category. |
offensive_avg48_three_point_field_goals_made | Float64 | Player's three-point field goals made per 48 minutes of play, drawn from the offensive statistical category. |
offensive_avg48_three_point_field_goals_attempted | Float64 | Player's three-point field goal attempts per 48 minutes of play, drawn from the offensive statistical category. |
offensive_avg48_free_throws_made | Float64 | Player's free throws made per 48 minutes of play, drawn from the offensive statistical category. |
offensive_avg48_free_throws_attempted | Float64 | Player's free throw attempts per 48 minutes of play, drawn from the offensive statistical category. |
offensive_avg48_points | Float64 | Player's points scored per 48 minutes of play, drawn from the offensive statistical category. |
offensive_avg48_offensive_rebounds | Float64 | Player's offensive rebounds per 48 minutes of play, drawn from the offensive statistical category. |
offensive_avg48_assists | Float64 | Player's assists per 48 minutes of play, drawn from the offensive statistical category. |
offensive_avg48_turnovers | Float64 | Player's turnovers per 48 minutes of play, drawn from the offensive statistical category. |
team_id | Int64 | Unique team identifier. |
team_uid | String | ESPN universal team identifier (UID format 's:40~l:...~t:...'). |
team_guid | String | ESPN team GUID. |
team_slug | String | URL-safe team identifier (e.g. 'lasvegas-aces' / 'aces'). |
team_location | String | Team city or location string. |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_display_name | String | Full team display name. |
team_short_display_name | String | Short team display name (e.g. 'Aces'). |
team_color | String | Team primary color (hex without leading '#'). |
team_alternate_color | String | Team alternate color (hex without leading '#'). |
team_is_active | Boolean | TRUE if the team is currently active. |
team_logo_href | String |
Raises
| Exception | Description |
|---|---|
ValueError | season_type is not "regular"/"postseason". |
sportsdataverse.errors.NoDataError | ESPN returned 404. |
sportsdataverse.errors.AssetFetchError | The 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
| Parameter | Type | Default | Description |
|---|---|---|---|
dates | int | None | Used to define different seasons. 2002 is the earliest available season. |
season_type | int | None | 2 for regular season, 3 for post-season, 4 for off-season. |
limit | int | 500 | number of records to return, default: 500. |
return_as_pandas | False |
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_name | type | description |
|---|---|---|
id | Int64 | Unique play identification number |
uid | String | ESPN UID string. |
date | String | Date in YYYY-MM-DD format. |
attendance | Int64 | Reported attendance. |
time_valid | Boolean | Time valid. |
neutral_site | Boolean | Neutral site. |
conference_competition | Boolean | Conference competition. |
play_by_play_available | Boolean | |
recent | Boolean | Recent. |
start_date | String | Start date (YYYY-MM-DD). |
broadcast | String | Broadcast information string. |
highlights | String | |
notes_type | String | Notes type. |
notes_headline | String | Notes headline. |
broadcast_market | String | Broadcast market label (e.g. 'national', 'home'). |
broadcast_name | String | Broadcast name. |
type_id | Int64 | Type identifier (numeric). |
type_abbreviation | String | Play type abbreviation |
venue_id | Int64 | Unique venue identifier. |
venue_full_name | String | Venue full name. |
venue_address_city | String | Venue address city. |
venue_address_state | String | Venue address state / region. |
venue_indoor | Boolean | TRUE if the venue is indoors. |
status_clock | Float64 | Status clock. |
status_display_clock | String | Status display clock. |
status_period | Int64 | Status period. |
status_type_id | Int64 | Unique identifier for status type. |
status_type_name | String | Status type name. |
status_type_state | String | Status type state. |
status_type_completed | Boolean | Status type completed. |
status_type_description | String | Status type description. |
status_type_detail | String | Status type detail. |
status_type_short_detail | String | Status type short detail. |
format_regulation_periods | Int64 | Format regulation periods. |
home_id | Int64 | Unique identifier for home. |
home_uid | String | Home team's uid. |
home_location | String | Home team's location. |
home_name | String | Home name. |
home_abbreviation | String | Home team's abbreviation. |
home_display_name | String | Home display name. |
home_short_display_name | String | Home short display name. |
home_color | String | Color code (hex) for home. |
home_alternate_color | String | Color code (hex) for home alternate. |
home_is_active | Boolean | Home team's is active. |
home_venue_id | Int64 | Unique identifier for home venue. |
home_logo | String | Home team logo URL. |
home_score | String | Home team score at the time of the play. |
home_winner | Boolean | Home team's winner. |
home_linescores | List | Period-by-period point totals for the home team, stored as a list of integer scores. |
home_records | String | Win-loss record strings for the home team across relevant splits (e.g., overall, home/away, conference). |
away_id | Int64 | Unique identifier for away. |
away_uid | String | Away team's uid. |
away_location | String | Away team's location. |
away_name | String | Away name. |
away_abbreviation | String | Away team's abbreviation. |
away_display_name | String | Away display name. |
away_short_display_name | String | Away short display name. |
away_color | String | Color code (hex) for away. |
away_alternate_color | String | Color code (hex) for away alternate. |
away_is_active | Boolean | Away team's is active. |
away_venue_id | Int64 | Unique identifier for away venue. |
away_logo | String | Away team logo URL. |
away_score | String | Away team score at the time of the play. |
away_winner | Boolean | Away team's winner. |
away_linescores | List | Period-by-period point totals for the away team, stored as a list of integer scores. |
away_records | String | Win-loss record strings for the away team across relevant splits (e.g., overall, home/away, conference). |
game_id | Int64 | Unique game identifier. |
season | Int64 | Season as a 4-digit starting year (integer). A 'YYYY-YY' string is not accepted. |
season_type | Int64 | Season type (1=pre-season, 2=regular season, 3=postseason, 4=off-season for ESPN; or string label for WNBA Stats). |
status_type_alt_detail | String | Status type alt detail. |
home_logo_dark | String | |
away_logo_dark | String |
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
| Parameter | Type | Default | Description |
|---|---|---|---|
season | int | Season year, forwarded to ESPN as ?season=YYYY. | |
raw | bool | False | If True, returns the parsed JSON dict before any flattening. |
return_as_pandas | bool | False | If 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_name | type | description |
|---|---|---|
team_id | Int64 | Unique team identifier. |
team_uid | String | ESPN universal team identifier (UID format 's:40~l:...~t:...'). |
team_slug | String | URL-safe team identifier (e.g. 'lasvegas-aces' / 'aces'). |
team_location | String | Team city or location string. |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_display_name | String | Full team display name. |
team_short_display_name | String | Short team display name (e.g. 'Aces'). |
team_color | String | Team primary color (hex without leading '#'). |
conference_id | Int64 | Conference identifier. |
conference_name | String | Full conference name. |
conference_abbreviation | String | Conference abbreviation, E (Eastern) or W (Western). |
wins | Int64 | Total wins. |
losses | Int64 | Total losses. |
win_percent | Float64 | Win percent. |
games_back | Float64 | Games behind the conference leader (0 for the leader). |
streak | String | Current streak (e.g. 'W3' for three-game win streak). |
points_for | Float64 | Points for. |
points_against | Float64 | Points allowed. |
point_differential | Float64 | Point differential. |
avg_points_for | Float64 | Points the team scored per game. |
avg_points_against | Float64 | Points the team allowed per game. |
home_wins | Int64 | Home team's wins. |
home_losses | Int64 | Home team's losses. |
road_wins | Int64 | Road wins. |
road_losses | Int64 | Road losses. |
division_wins | Int64 | Wins against division opponents; the WNBA has no divisions, so ESPN sends 0. |
division_losses | Int64 | Losses against division opponents; the WNBA has no divisions, so ESPN sends 0. |
season | Int64 | Season identifier (4-digit year or 'YYYY-YY' string). |
Raises
| Exception | Description |
|---|---|
sportsdataverse.errors.NoDataError | ESPN returned 404. |
requests.exceptions.RequestException | Other 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
| Parameter | Type | Default | Description |
|---|---|---|---|
team_id | int | ESPN WNBA team identifier (e.g. 3 for Dallas Wings). | |
season | int | None | None | Season year (recorded as output column only). |
raw | bool | False | If True, returns the parsed JSON dict before any flattening. |
return_as_pandas | bool | False | If 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_name | type | description |
|---|---|---|
athlete_id | String | Unique athlete identifier (ESPN). |
athlete_uid | String | ESPN athlete UID (universal identifier). |
first_name | String | Player's first name. |
last_name | String | Player's last name. |
full_name | String | Player's full name. |
display_name | String | Display name. |
short_name | String | Short display name. |
jersey | String | Jersey number worn by the player. |
position_id | String | Unique position identifier. |
position_name | String | Listed roster position ('Guard', 'Forward', 'Center'). |
position_abbreviation | String | Position abbreviation ('G' / 'F' / 'C'). |
height | Float64 | Player height (string e.g. '6-2' or inches). |
display_height | String | Player height in display format (e.g. '6-2'). |
weight | Float64 | Player weight in pounds. |
display_weight | String | Player weight in display format (e.g. '180 lbs'). |
age | Int64 | Player age (in years). |
date_of_birth | String | Date of birth (YYYY-MM-DD). |
birth_city | String | Birth city. |
birth_state | String | Birth state / region. |
headshot_href | String | Headshot image URL. |
link_web | String | Web link / URL. |
status_name | String | Status label. |
team_id | Int64 | Unique team identifier. |
season | Int64 | Season identifier (4-digit year or 'YYYY-YY' string). |
Raises
| Exception | Description |
|---|---|
sportsdataverse.errors.NoDataError | ESPN returned 404. |
requests.exceptions.RequestException | Other 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
| Parameter | Type | Default | Description |
|---|---|---|---|
team_id | int | ESPN WNBA team identifier (e.g. 17 for the Las Vegas Aces). | |
season | int | Season year, forwarded to ESPN as ?season=YYYY. | |
raw | bool | False | If True, returns the parsed JSON dict before any flattening. |
return_as_pandas | bool | False | If 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
| Exception | Description |
|---|---|
sportsdataverse.errors.NoDataError | ESPN returned 404. |
requests.exceptions.RequestException | Other 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
| Parameter | Type | Default | Description |
|---|---|---|---|
return_as_pandas | bool | False | If 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_name | type | description |
|---|---|---|
team_abbreviation | String | Short team abbreviation (e.g. 'LAS'). |
team_alternate_color | String | Team alternate color (hex without leading '#'). |
team_color | String | Team primary color (hex without leading '#'). |
team_display_name | String | Full team display name. |
team_id | Int64 | Unique team identifier. |
team_is_active | Boolean | TRUE if the team is currently active. |
team_is_all_star | Boolean | TRUE if the row represents an All-Star team. |
team_location | String | Team city or location string. |
team_logos | Int64 | |
team_name | String | Full team display name (e.g. 'Las Vegas Aces'). |
team_nickname | String | Team nickname. |
team_short_display_name | String | Short team display name (e.g. 'Aces'). |
team_slug | String | URL-safe team identifier (e.g. 'lasvegas-aces' / 'aces'). |
team_uid | String | ESPN universal team identifier (UID format 's:40~l:...~t:...'). |
Raises
| Exception | Description |
|---|---|
NoDataError | ESPN answered 404 for the teams resource. |
AssetFetchError | The 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
| Parameter | Type | Default | Description |
|---|---|---|---|
event | One 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.