Skip to content

WeakSide-Breakout-Analysis/wsba_hockey

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

113 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

NHL Rosters and Player Information

wsba.nhl_scrape_roster(20242025)
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.)

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

About

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".

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages