Skip to main content

WeakSide Breakout's complete Python package of access to hockey data, primairly including the scraping of National Hockey League schedule, play-by-play, and shifts information.

Project description

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, including incorporation of analytics.

INSTALLATION AND USAGE

pip install wsba_hockey
import wsba_hockey as wsba

ALL FEATURES

Note: Features yet included are marked with *

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(arg = '2024-03-20')

NHL Rosters and Player Information

wsba.nhl_scrape_roster('20242025')
wsba.nhl_scrape_team_info()

NHL Draft Rankings and Prospects

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

DATA ANALYTICS

Expected Goals (WeakSide Breakout and MoneyPuck models)

Goal Impacts and Shot Analysis

Stat Aggregation

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

Shot Plotting (Plots, Heatmaps, etc.)

skater_dict = {
    'Patrice Bergeron':['20212022','BOS']
}
pbp = wsba.nhl_scrape_season('20212022',remove=[], local = True)

wsba.nhl_plot_skater_shots(pbp,skater_dict,['5v5'],legend=True)
wsba.nhl_plot_games(pbp,legend=True)

REPOSITORY

Past Season Play-by-Play

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

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'])

ACKNOWLEDGEMENTS AND CREDITS

Huge thanks to the following:

Harry Shomer - Creator of the hockey_scraper package, which contains select utils functions within this package and otherwise inspires the creation of this package.

Dan Morse - Creator of the hockeyR package; another important inspiration and model for developing an NHL scraper.

Patrick Bacon - Creator of TopDownHockey package

MoneyPuck - Source of available xG data in the package

Anyone in the NHL Public Analytics community who has stuck around and supported WeakSide Breakout Analysis hockey.

Project details


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-0.1.4.tar.gz (51.0 kB view details)

Uploaded Source

Built Distribution

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

wsba_hockey-0.1.4-py3-none-any.whl (54.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wsba_hockey-0.1.4.tar.gz
  • Upload date:
  • Size: 51.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for wsba_hockey-0.1.4.tar.gz
Algorithm Hash digest
SHA256 48e81ad102e96a1ce4d4d368a4ffd1e766b20ba25aff6026fe30a0b98564faf4
MD5 893a23fba0a394ba30020384c9290992
BLAKE2b-256 2fce4ac8eeddc3147a5e80d498820d0eafadebc4e39e8b897f7760beee159273

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wsba_hockey-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 54.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.1

File hashes

Hashes for wsba_hockey-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 50905e851be218b989596ef90f0d245fa1ab19d78c85c51388a6c6c74cd71d17
MD5 4f4bf6be58aac70901a565380f0b3430
BLAKE2b-256 46df99832b3c4956cb879e1c7b577dfcefdcbf0031d5e68fcedc81a0f03067a1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page