π NHL hockey with sportsdataverse-py
Welcome to the show! π sportsdataverse.nhl gives you the NHL's own modern
feed β the same api-web.nhle.com data that powers NHL.com β plus the shiny
NHL EDGE puck-and-player tracking layer, the api.nhle.com stats-REST and
records flat APIs, an ESPN fallback, and fast parquet loaders. All of it hands
you tidy polars DataFrames, ready to model. π
We'll lead with the premium native wrappers (the nhl_* and nhl_edge_*
functions) β they're the league's first-party data, no key required β and keep
ESPN (espn_nhl_*) as a friendly secondary path.
R user? The companion package is fastRhockey (NHL + PWHL). Let's drop the puck! π
π§° The toolboxβ
Every native call returns a tidy polars DataFrame by default β pass
return_as_pandas=True for pandas, or return_parsed=False for the raw JSON.
Here's the kit we'll use (click any name for the full reference). The β rows
are the premium native NHL feed β start there.
| Function | What it gives you | Source |
|---|---|---|
nhl_web_schedule | A day's games + scores, native ids | β NHL api-web |
nhl_web_pbp | Event-level play-by-play (one row per event) |