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

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

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,remove=[], local = True)
wsba.nhl_calculate_stats(pbp,'skater',[2],['5v5','4v4','3v3'],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_skaters_shots(pbp,skater_dict,['5v5'],onice='for',legend=True)
wsba.nhl_plot_heatmap(pbp,skater_dict,['5v5','3v3','4v4'],'Even Strength')
wsba.nhl_plot_games(pbp,legend=True)

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

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

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-1.3.2.tar.gz (71.3 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-1.3.2-py3-none-any.whl (74.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for wsba_hockey-1.3.2.tar.gz
Algorithm Hash digest
SHA256 ade0d2b4b1c7799dddce98692fe9a584daf5ec6f33b57338d57d6af919ec76d5
MD5 8cb252a8293bc64603194a15fa43313b
BLAKE2b-256 2294cc86739beb91a239fdf7544c587b8db9af24a5d5cec0c4d979f06e939547

See more details on using hashes here.

File details

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

File metadata

  • Download URL: wsba_hockey-1.3.2-py3-none-any.whl
  • Upload date:
  • Size: 74.1 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-1.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 390d2e8f00afb92896c4c1da78599c69ee6cb74709443d818632fc68acc65e63
MD5 1831bff7b976e5a21f7f4e0ed81585e8
BLAKE2b-256 63123a5a7aea8c5535da77e2122897ae497ffdbf4a2311a63c9524553f5b640c

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