WeakSide Breakout's Python package for hockey data, primarily including National Hockey League schedule, play-by-play, roster, standings, and shift information.
Project description
WSBA HOCKEY
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)
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'])
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:
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
Project details
Release history Release notifications | RSS feed
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.6.0.tar.gz
(2.0 MB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wsba_hockey-1.6.0.tar.gz.
File metadata
- Download URL: wsba_hockey-1.6.0.tar.gz
- Upload date:
- Size: 2.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9aa179e635914909329d5fdf484f7c81169ff1f59048eb5cecc4430c1983e2b2
|
|
| MD5 |
2b8bbcf5a7c3fd9bbae916ce6459958b
|
|
| BLAKE2b-256 |
8ea76ff37ed40cac35f77d2b63604d2b1c2d472b76fcde05c260f5633f3cf068
|
File details
Details for the file wsba_hockey-1.6.0-py3-none-any.whl.
File metadata
- Download URL: wsba_hockey-1.6.0-py3-none-any.whl
- Upload date:
- Size: 2.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1125a61c382f75cb1f582b77a6cd29b1dc7fb18b1b574758db57815fa86a03a8
|
|
| MD5 |
c0e37e5b54a492fc4294758af98ec2f5
|
|
| BLAKE2b-256 |
9b488f66f04da2683d6f8878f57bf465da194e54b939b7d897d6b3c197751fe4
|