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.5.tar.gz (12.0 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.5-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: statsapiclient-0.1.5.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0 CPython/3.8.1 Linux/4.15.0-1052-aws

File hashes

Hashes for statsapiclient-0.1.5.tar.gz
Algorithm Hash digest
SHA256 b1cb322c56e5952c4b93442af349ce844b5c59902ff99b76dec0139cc2bd72b1
MD5 0ad409c1b1695f8b72d422a3e419d648
BLAKE2b-256 30ec77afede25a04a1b3f4c79782b29d02ad6dd16a1c9ed5efbc6eb2c759d1ea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: statsapiclient-0.1.5-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.1 Linux/4.15.0-1052-aws

File hashes

Hashes for statsapiclient-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 49772a341b9f79ca812e6e3ff6dbcc7ffd7046cfca9662ab93c08bc55b529b9e
MD5 05bea9bbab9de8f4f35ffed51ea9c468
BLAKE2b-256 09e543d4770ecac2e40c015ee8259e3ff6b8884bfec48be59bac7f5685ab6062

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