A wrapper around the NHL’s JSON API.
Project description
statsapiclient: A client for the NHL stats API
Purpose
To provide a Python client to access the NHL's JSON API including game, play, and player data.
Installation
pip install -i https://test.pypi.org/simple/ statsapiclient
Modules
Schedule
get_games
Returns a list of games contained within the instantiated date or date range.
Games
game
get_box_score
get_line_score
get_play_by_play
Teams
get_active
Returns a list of all active teams.
get_active_by_conference
Returns a list of all active teams in a given conference.
get_active_by_division
Returns a list of all active teams in a given division.
Examples
Games from date:
from statsapiclient.schedule import Schedule
s = Schedule('2019-01-01')
games = s.get_games()
print(games[0]['gamePk']) # 2018020612
Game data:
from statsapiclient.games.game import Game
g = Game('2018020612')
box_score = g.get_box_score()
line_score = g.get_line_score()
play_by_play = g.get_play_by_play()
For more: Jupyter notebook
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
statsapiclient-0.1.1.tar.gz
(10.7 kB
view hashes)
Built Distribution
Close
Hashes for statsapiclient-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36a45caf83d0d4e4d9bd7c000abcff7a7511f6babf2bdf0306a602873701290c |
|
MD5 | 247206cd8cd4cb783dbea1a85c48452d |
|
BLAKE2b-256 | db0c8ec6fcc926c1e509f4e1dc02b4a640d8e3d230adcb7bac670fd77ac262da |