Skip to main content

WSBA HOCKEY

WSBA128

A Python package for scraping and analyzing hockey data under the motto: Evaluating, analyzing, and understanding the game of hockey through the lens of different analytical methods.

INSTALLATION AND USAGE

pip install wsba_hockey
import wsba_hockey as wsba

ALL FEATURES

SCRAPING

NHL Play-by-Play (of any game frame up to a full season)

Functions:

wsba.nhl_scrape_game(2024020918,split_shifts=False,remove=['game-end'])
wsba.nhl_scrape_season(20242025,split_shifts=False,remove=['game-end'],local=True)

Reusing Sessions and Workers

import wsba_hockey as wsba
import wsba_hockey.tools.http as http

http.POOL_WORKERS = 4

with wsba.make_pooled_session() as session:
    games = [2024020918, 2024020919]
    pbp = [wsba.nhl_scrape_game(game, session=session) for game in games]

NHL Season Information

wsba.nhl_scrape_schedule(20242025)
wsba.nhl_scrape_seasons_info(seasons=[20212022,20222023,20232024,20242025])
wsba.nhl_scrape_standings()

NHL Rosters and Player Information

wsba.nhl_scrape_roster(20242025)
wsba.nhl_scrape_player_info([8477956, 8479987])
wsba.nhl_scrape_team_info()

NHL Draft Rankings and Prospects

wsba.nhl_scrape_draft_rankings()
wsba.nhl_scrape_prospects('BOS')

NHL EDGE Data

wsba.nhl_scrape_edge(20252026,'skater',[8477956, 8479987])
wsba.nhl_scrape_edge(20252026,'goalie',[8480280])
wsba.nhl_scrape_edge(20252026,'team',['BOS'])

NHL Event Tracking Data

wsba.nhl_scrape_event_data({2023020001: [101, 102]})

DATA ANALYTICS

Expected Goals

pbp = wsba.nhl_scrape_game(2024020918,split_shifts=False,remove=['game-end'])
pbp = wsba.nhl_apply_xG(pbp)

Goal Impacts and Shot Analysis

Stat Aggregation

pbp = wsba.nhl_scrape_season(20232024, local = True)
wsba.nhl_calculate_stats(pbp,'skater',['5v5','4v4','3v3'], 'all',shot_impact = True)

Shot Plotting (Plots, Heatmaps, etc.)

pbp = wsba.nhl_scrape_season(20212022, remove=[], local=True)

plots = wsba.nhl_plot_events(
    pbp,
    group="game",
    entities=[2021020002],
    events=["goal", "shot-on-goal", "missed-shot", "blocked-shot"],
    strengths=["5v5"],
    season_types=2,
    legend=True,
    rotation=0,
    display_range="full",
)
plots[2021020002].savefig("skater_events.png", bbox_inches="tight")

Sample Plot:

Sample Plot

REPOSITORY

Team Information

wsba.repo_load_teaminfo()
wsba.repo_load_rosters(seasons=[20212022,20222023,20232024,20242025])

Schedule

wsba.repo_load_schedule(seasons=[20212022,20222023,20232024,20242025])

DOCUMENTATION

View full documentation here: WSBA Hockey Package Documentation

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wsba_hockey-1.7.0.tar.gz (2.0 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wsba_hockey-1.7.0-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

Details for the file wsba_hockey-1.7.0.tar.gz.

File metadata

  • Download URL: wsba_hockey-1.7.0.tar.gz
  • Upload date:
  • Size: 2.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for wsba_hockey-1.7.0.tar.gz
Algorithm Hash digest
SHA256 f09706c1d4d9066e9fbbbf6572d52a41a808a56cd585d983df9bcc672e011569
MD5 cedd9b1a54a71388e87d6a353eb19955
BLAKE2b-256 f783d7071993bf0ad580269e427e466b929cc7fbd1f3c448b7cea6b38d1bf8d1

See more details on using hashes here.

File details

Details for the file wsba_hockey-1.7.0-py3-none-any.whl.

File metadata

  • Download URL: wsba_hockey-1.7.0-py3-none-any.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for wsba_hockey-1.7.0-py3-none-any.whl
Algorithm Hash digest
SHA256 52f5a0260786de8187f8bbd97cd65fa14ae3814ffbf68701dd1ecc198f23d7b4
MD5 d972be093011feca1f20be4a64c5cb90
BLAKE2b-256 fde90f42fcc3b772434cafa1cebcd3a89c568b8077e99ae61325a646e49d2431

See more details on using hashes here.

Release history Release notifications | RSS feed

1.7.3

2 files

1.7.2

2 files

1.7.1

2 files

This release

1.7.0 This release

2 files

1.6.3

2 files

1.6.2

2 files

1.6.1

2 files

1.6.0

2 files

1.4.1

2 files

1.4.0

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.9

2 files

1.2.8

2 files

1.2.7

2 files

1.2.6

2 files

1.2.5

2 files

1.2.4

2 files

1.2.3

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.9

2 files

1.1.8

2 files

1.1.7

2 files

1.1.6

2 files

1.1.5

2 files

1.1.3

2 files

1.1.2

2 files

1.1.1

2 files

1.1.0

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

0.1.4

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page