The NHL Scraper API is a free Python library provided under Apache License version 2.0. Currently, Play-by-Play, Home/Away TOI, Roster, Face-off Comparison and Event Summary reports are functional. The first full stable release (v1.0.0) will be made available once the framework for all NHL game reports are completed. This is a pre-release and is not stable and fully fit for production. # define stat types that will be counted as the plays are parsed cum_stats = '. Regular # regular season game game_key = GameKey( season, game_type, game_num) cumstats import Score, ShotCt, Corsi, Fenwick season = 2014 # 2013-2014 season game_num = 1226 # game_type = GameType. game import Game, GameKey, GameType from nhlscrapi. Scrape data for game 1226 of 2014, Ottawa vs Pittsburgh.įrom nhlscrapi. The documentation for the package can be found at nhlscrapi: NHL Scraper API. Getting started is as easy as: pip install nhlscrapiįor more information on the setup, see the PyPi: nhlscrapi. Currently, the package support most of the game summary reports, but all of the important and essential ones. P The number of points a player has, which is simply the total of their goals and assists combined. G The number of goals a player has scored. Nhlscrapi is in the early/initial stages, but will be updated regularly. GP This stands for games played and simply displays how many games a player has participated in. This project is inspired by the R package nhlscrapr, an all around must for NHL analytics geeks and R power users. The library hides the guts of the NHL website scraping process and encapsulates not only the data gathering, but data output. Provide a Python API for accessing NHL game data including play by play, game summaries, player stats et c. So please, someone just write a nice client for that API. Better yet, if you want the game feed for the first game of the 2017-2018 season? Go here.īest of all, the nhlapi project on GitLab is working to uncover and document the endpoints. While it seems inexplicable that they'd be the first team anyone would put into their database, it's the NHL. Just use that.įor example, if you put in your browser you'll get some nice JSON about the NJ Devils. Back then parsing horrendously structured HTML files from the NHL site was basically the only way to go. I wrote this as a way to learn python (the quality in here, yikes) seemingly forever ago. Nhlscrapi: NHL Scraper API All good things.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |