Women's college basketball — additional Python functions — Her Hoop Stats
has_herhoopstats_login
has_herhoopstats_login() -> 'bool'
Whether Her Hoop Stats credentials are set in the environment.
Returns
True when both an e-mail and a password resolve from the environment.
Example
import pytest
from sportsdataverse.wbb import has_herhoopstats_login
pytestmark = pytest.mark.skipif(
not has_herhoopstats_login(), reason="no Her Hoop Stats login"
)
herhoopstats_login
herhoopstats_login(email: 'Optional[str]' = None, password: 'Optional[str]' = None, *, proxy: 'Any' = None) -> 'requests.Session'
Log into herhoopstats.com and return the authenticated session.
The Python counterpart of wehoop's .hhs_login(). Optional -- every
wrapper logs in on demand and reuses a cached session -- but it is the
fastest way to verify credentials or a proxy before a long pull, and the
returned session can be handed to a wrapper as session=.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
email | Optional[str] | None | Subscription e-mail. Falls back to HERHOOPSTATS_EMAIL. |
password | Optional[str] | None | Subscription password. Falls back to HERHOOPSTATS_PW. |
proxy | Any | None | Proxy URL str or requests proxies= dict. Falls back to SDV_PY_HERHOOPSTATS_PROXY then SDV_PY_PROXY. |
Returns
An authenticated requests.Session.
Raises
| Exception | Description |
|---|---|
RuntimeError | When credentials cannot be resolved, or the site rejects them. |
Example
from sportsdataverse.wbb import herhoopstats_login
session = herhoopstats_login(proxy="http://user:pw@proxy.example:8080")
herhoopstats_team_roster
herhoopstats_team_roster(team_link: 'str', *, email: 'Optional[str]' = None, password: 'Optional[str]' = None, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> 'pl.DataFrame | pd.DataFrame'
The player roster table from one Her Hoop Stats team page.
Port of wehoop's hhs_team_roster(): picks the table carrying a player /
name column. A page without one has no roster: it answers a zero-row frame with the
roster columns, never another table (wehoop falls back to the tallest table).
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
team_link | str | A team page path or full URL. | |
email | Optional[str] | None | Subscription e-mail; falls back to HERHOOPSTATS_EMAIL. |
password | Optional[str] | None | Subscription password; falls back to HERHOOPSTATS_PW. |
return_as_pandas | bool | False | Return a pandas.DataFrame instead of polars. |
Returns
One row per player. A zero-row frame with the roster columns when the page carried no roster.
| col_name | type | description |
|---|---|---|
player | String | Player name. |
g | Int64 | Games played. |
gs | Int64 | Games started. |
min | Float64 | Minutes played. |
pts | Float64 | Points scored. |
trb | Float64 | Career total rebounds. |
ast | Float64 | Assists. |
tov | Float64 | Turnovers. |
stl | Float64 | Steals. |
blk | Float64 | Blocks. |
fg_pct | String | Field goal percentage (0-1). |
ft_pct | String | Free throw percentage (0-1). |
2_p_pct | String | |
3_p_pct | String |
Raises
| Exception | Description |
|---|---|
RuntimeError | When credentials cannot be resolved or are rejected. |
AssetFetchError | The fetch failed, or the page was the free-tier teaser (the session expired or the subscription lapsed), never returned as data. |
Example
from sportsdataverse.wbb import herhoopstats_team_roster
roster = herhoopstats_team_roster("/stats/ncaa/team/12345/2024/")
herhoopstats_team_stats
herhoopstats_team_stats(team_link: 'str', *, email: 'Optional[str]' = None, password: 'Optional[str]' = None, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> 'Dict[str, pl.DataFrame | pd.DataFrame]'
Every table on one Her Hoop Stats team page.
Port of wehoop's hhs_team_stats(), which keeps only the tallest table.
This returns all of them keyed by the table's HTML id (else caption, else
position), so a single fetch covers the whole page.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
team_link | str | A team page path or full URL -- e.g. a link taken from the team-page column of herhoopstats_teams. | |
email | Optional[str] | None | Subscription e-mail; falls back to HERHOOPSTATS_EMAIL. |
password | Optional[str] | None | Subscription password; falls back to HERHOOPSTATS_PW. |
return_as_pandas | bool | False | Return pandas.DataFrame values instead of polars. |
Returns
{table_key: DataFrame}; empty when the page carried no data table.
Raises
| Exception | Description |
|---|---|
RuntimeError | When credentials cannot be resolved or are rejected. |
AssetFetchError | The fetch failed, or the page was the free-tier teaser (the session expired or the subscription lapsed), never returned as data. |
Example
from sportsdataverse.wbb import herhoopstats_team_stats
tables = herhoopstats_team_stats("/stats/ncaa/team/12345/2024/")
list(tables)
herhoopstats_teams
herhoopstats_teams(min_season: 'int', max_season: 'Optional[int]' = None, division: 'int' = 1, *, email: 'Optional[str]' = None, password: 'Optional[str]' = None, return_as_pandas: 'bool' = False, **kwargs: 'Any') -> 'pl.DataFrame | pd.DataFrame'
NCAA women's team single-season summary table.
Port of wehoop's hhs_teams(). One row per team-season (record, scoring,
per-100-possession columns), with the requested min_season /
max_season / division attached so concatenated pulls stay traceable.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
min_season | int | First season, as a 4-digit ENDING year (2024 = 2023-24). | |
max_season | Optional[int] | None | Last season, same convention. Defaults to min_season. |
division | int | 1 | NCAA division -- 1 (default), 2 or 3. |
email | Optional[str] | None | Subscription e-mail; falls back to HERHOOPSTATS_EMAIL. |
password | Optional[str] | None | Subscription password; falls back to HERHOOPSTATS_PW. |
return_as_pandas | bool | False | Return a pandas.DataFrame instead of polars. |
Returns
One row per team-season, plus a team_link column carrying each team's page path -- the only way to reach herhoopstats_team_stats / herhoopstats_team_roster. A zero-row frame when nothing matched.
| col_name | type | description |
|---|---|---|
season | String | Season identifier (4-digit year or 'YYYY-YY' string). |
team | String | Team-side label or team identifier. |
g | Int64 | Games played. |
w | Int64 | Wins. |
l | Int64 | Losses. |
win_pct | String | Win percentage (0-1 decimal). |
pts | Float64 | Points scored. |
opp_pts | Float64 | Opponent points. |
net_pts | Float64 | |
off_rtg | Float64 | |
def_rtg | Float64 | |
net_rtg | Float64 | |
pace | Float64 | Possessions per 48 minutes. |
team_link | String | |
min_season | Int64 | |
max_season | Int64 | |
division | Int64 | Team division. |
Raises
| Exception | Description |
|---|---|
RuntimeError | When credentials cannot be resolved or are rejected. |
AssetFetchError | The fetch failed, or the page was the free-tier teaser (the session expired or the subscription lapsed), never returned as data. |
Example
from sportsdataverse.wbb import herhoopstats_teams
teams = herhoopstats_teams(min_season=2024, division=1)
# Multiple seasons, through a proxy
teams = herhoopstats_teams(2022, 2024, proxy="http://127.0.0.1:8888")