Skip to main content

A minimum-dependency Python interface to the NHL API.

Project description

nhlapip - Low-dependency NHL API interface for Python

Install and Test Pandas Showcase CLI Showcase Lint

Installation

Install nhlapip with pip:

pip install nhlapip

Usage

With Python

The API is exposed via endpoint-based classes. See below for a full list of endpoints. Some quick examples:

# Player Data for Joe Sakic
from nhlapip.player import Player
sakic = Player('8451101')
print(sakic.get_data())

# Player's All Seasons Statistics
print(sakic.get_stats_allseasons())

# All Teams' Rosters
from nhlapip.team import Team
all_teams = Team()
print(all_teams.get_roster())

Many usage examples can be found in the Pandas showcase that shows data retrieval for many endpoints.

Command line interface (CLI)

A very simple CLI is also available. This is still in active development. Some examples:

echo '\n\Get data nhlapip for 1 player:\n'
nhlapip Player 8451101

echo '\n\nGet data for 2 Teams :\n'
nhlapip Team 1 2

Many usage examples can be found in the CLI showcase that shows CLI data retrieval for many endpoints.

Currently implemented endpoints

Major endpoints

  • Teams

    • Team Metadata Team().get_data()
    • Team Rosters Team().get_roster()
    • Team Schedules Team().get_schedule_next(), Team().get_schedule_previous()
    • Team Stats Team().get_stats()
  • People (Player)

    • Players metadata Player.get_data()
    • Players all season stats Player.get_stats_allseasons()
  • Games (Game)

    • Games content Game.get_content()
    • Games full live feed Game.get_feed()
    • Games box score info Game.get_boxscore()
    • Games line score info Game.get_linescore()
  • Tournaments

    • Playoffs Tournament("playoffs")
    • Olympics Tournament("olympics")
    • World Cups Tournament("worldcup")
  • Schedule

    • Generic API with all parameters Schedule()
  • Standings Standings()

Minor endpoints

  • Divisions Divisions()
  • Conferences Conferences()
  • Drafts Drafts()
  • Seasons Seasons()
  • Awards Awards()
  • Venues Venues()
  • Draft prospects DraftProspects()

Metadata endpoints

  • Game Types GameTypesMd()
  • Game Statuses GameStatusMd()
  • Play Types PlayTypesMd()
  • Tournament Types TournamentTypesMd()
  • Standings Types StandingsTypesMd()
  • Stats Types StatTypesMd()
  • Event Types EventTypesMd()

NHL API data for R users

This package is a Python port of a more mature and feature-rich R package {nhlapi}. If you are an R user, please check the package out on GitHub and on CRAN.

Acknowledgments

Thanks go to Drew Hynes for documenting this so well on GitLab.

Copyright message

NHL and the NHL Shield are registered trademarks of the National Hockey League. NHL and NHL team marks are the property of the NHL and its teams. © NHL 2020. All Rights Reserved.

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

nhlapip-0.0.1.tar.gz (11.5 kB view details)

Uploaded Source

Built Distributions

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

nhlapip-0.0.1-py3.8.egg (22.1 kB view details)

Uploaded Egg

nhlapip-0.0.1-py3.6.egg (61.7 kB view details)

Uploaded Egg

nhlapip-0.0.1-py3-none-any.whl (36.7 kB view details)

Uploaded Python 3

File details

Details for the file nhlapip-0.0.1.tar.gz.

File metadata

  • Download URL: nhlapip-0.0.1.tar.gz
  • Upload date:
  • Size: 11.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for nhlapip-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e2236f74b82f0e81f8ca37b90486412e4275c0ae279e212fce12b0c01be613b9
MD5 7adddaa743432af177a0b7ff49c4f6f6
BLAKE2b-256 0530e0413b3bd3b45ba0c228b767abbc9440e9288213a3dcc6a96f3fa5f7d265

See more details on using hashes here.

File details

Details for the file nhlapip-0.0.1-py3.8.egg.

File metadata

  • Download URL: nhlapip-0.0.1-py3.8.egg
  • Upload date:
  • Size: 22.1 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for nhlapip-0.0.1-py3.8.egg
Algorithm Hash digest
SHA256 43298dec26c1676d07e3756b4549837a81c6f92fdbff207a8dffc5313e95287c
MD5 cc8405f448a578cb412fc5432aaba790
BLAKE2b-256 b2d9d2e10f2c47f834d20a339f89cf9a8a80c1e84c8aa70b94c64842f925b5cb

See more details on using hashes here.

File details

Details for the file nhlapip-0.0.1-py3.6.egg.

File metadata

  • Download URL: nhlapip-0.0.1-py3.6.egg
  • Upload date:
  • Size: 61.7 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for nhlapip-0.0.1-py3.6.egg
Algorithm Hash digest
SHA256 e7864623be43e8042d95737ad560a996e2bf9723cce12c4eaad71e3858dfce04
MD5 d2c6c1528c1c534fdef7a847caaf6310
BLAKE2b-256 c64685459dbfa2490266277152ec9dbfc1d863253ecd432379e724c1ad88c06f

See more details on using hashes here.

File details

Details for the file nhlapip-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: nhlapip-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 36.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.6.9

File hashes

Hashes for nhlapip-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 051297877761b71a116b0d32f8b6d62d1d7f6dec624cbcd61e82c3e5f3b3707e
MD5 57d21b3c9459b37d75bf2e69a4ebb118
BLAKE2b-256 d86d5d1864456ef024e12809a3355856bb6c8317d1111f4e12631eec808c55ba

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