Skip to main content

A wrapper around the NHL’s JSON API.

Project description

statsapiclient: A client for the NHL stats API

PyPI version

CircleCI

Purpose

To provide a Python client to access the NHL's JSON API including game, play, and player data.

Installation

pip install statsapiclient

Modules

Schedule

games

A list of games contained within the instantiated date or date range.

Games

game

json

Raw JSON response data.

box_score

Box score object.

line_score

Line score object.

plays

Play object.

Team

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')
print(s.games[0]['gamePk'])    # 2018020612

Game data:

from statsapiclient.games.game import Game

g = Game('2018020612')

box_score = g.box_score
line_score = g.line_score
play_by_play = g.plays

Play data:

g.plays.all_plays                   # All plays
g.plays.get_plays_by_period(1)      # All plays in the first period
g.plays.get_penalty_plays()         # All penalty plays
g.plays.get_scoring_plays()         # All scoring plays

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

statsapiclient-0.1.4.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

statsapiclient-0.1.4-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

Details for the file statsapiclient-0.1.4.tar.gz.

File metadata

  • Download URL: statsapiclient-0.1.4.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.8.0 Darwin/19.2.0

File hashes

Hashes for statsapiclient-0.1.4.tar.gz
Algorithm Hash digest
SHA256 cb0a00a938674ad6942e34e4c436e9092acc8877daf921e70d2faa7ea9912399
MD5 10ad1b502fae270b7dcbca450d288dae
BLAKE2b-256 6ce42915df51a4050e73a4c157c897729d729390933da9b741ddb0896ecf48b4

See more details on using hashes here.

File details

Details for the file statsapiclient-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: statsapiclient-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 18.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.8.0 Darwin/19.2.0

File hashes

Hashes for statsapiclient-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9b0904006a90e4ab147f9a6867b3319bc7711852548f033a3b50af73e166da13
MD5 a81fe9652a06a725686e55324dcefe08
BLAKE2b-256 92c2a41db285eedde3727c48bbe2d4b26f49351d4803426010c688d467e18628

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