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.2.tar.gz
(10.6 kB
view hashes)
Built Distribution
Close
Hashes for statsapiclient-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 30996f4c4090f11ae0200e606c1ba983b18671a9b5d304dea64aa962e41153a7 |
|
MD5 | f361c0269fb9dfd2b269690eac802be5 |
|
BLAKE2b-256 | 64df3d1da2323c3f08fa5f9042c7aa5324c9c4d59e29afb35a2aebc8c1ceb359 |