Skip to main content

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 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

Release files for statsapiclient 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for statsapiclient 0.2.1
File Size Uploaded
statsapiclient-0.2.1.tar.gz 12.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for statsapiclient 0.2.1
File Interpreter ABI Platform
statsapiclient-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 32.9 kB

Release files / statsapiclient-0.2.1.tar.gz

Download URL statsapiclient-0.2.1.tar.gz
Size 12.9 kB
Tags Source
SHA-256 checksum
How to use checksums
055f39daa13d0035d031c7f66dee282ba04c6b35f40b5e0b7a15bc5aa277af43
BLAKE2b-256 checksum
How to use checksums
4a03b9ebac7d050af678691545d8ffd1d2663655f67c5cfa39a104d097fee119
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.10 CPython/3.8.12 Linux/4.15.0-1106-aws

Release files / statsapiclient-0.2.1-py3-none-any.whl

Download URL statsapiclient-0.2.1-py3-none-any.whl
Size 20.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8d7124ae6c8b76fcca52e5d36b29bae445dedda7f634eec2887682067bd63bda
BLAKE2b-256 checksum
How to use checksums
7dc2ed8fc3a4afde10e27d36f5d16062f9f1fc020ed2bf9d11b21da4f54f61b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.1.10 CPython/3.8.12 Linux/4.15.0-1106-aws

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.3

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page