Functions to Access Hockey Play by Play Data from the NHL API
Project description
powerplay (Py)
A Python client for the NHL API
Documenting the publicly accessible portions of the NHL API.
Overview
This Python package is automatically generated by the Swagger Codegen project.
Installation & Usage
pip install
powerplay can be installed via pip:
pip install powerplay
or from the repo (which may at times be more up to date):
git clone https://github.com/saiemgilani/powerplay-py
cd powerplay-py
pip install -e .
(you may need to run pip
with root permission: sudo pip install git+https://github.com/saiemgilani/powerplay-py.git
)
Then import the package:
import powerplay
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install
to install the package for all users)
Then import the package:
import powerplay
Requirements.
Python 3.6+
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import powerplay
from powerplay.rest import ApiException
from pprint import pprint
# create an instance of the API class
api_instance = powerplay.ConferencesApi(powerplay.ApiClient(configuration))
id = 1.2 # float | The ID of the conference.
try:
# Get an NHL conference.
api_response = api_instance.get_conference(id)
pprint(api_response)
except ApiException as e:
print("Exception when calling ConferencesApi->get_conference: %s\n" % e)
# create an instance of the API class
api_instance = powerplay.ConferencesApi(powerplay.ApiClient(configuration))
try:
# Get all current NHL conferences.
api_response = api_instance.get_conferences()
pprint(api_response)
except ApiException as e:
print("Exception when calling ConferencesApi->get_conferences: %s\n" % e)
Documentation for API Endpoints
All URIs are relative to https://statsapi.web.nhl.com/api/v1
Class | Method | HTTP request | Description |
---|---|---|---|
ConferencesApi | get_conference | GET /conferences/{id} | Get an NHL conference. |
ConferencesApi | get_conferences | GET /conferences | Get all current NHL conferences. |
DivisionsApi | get_division | GET /divisions/{id} | Get an NHL division. |
DivisionsApi | get_divisions | GET /divisions | Get all current NHL divisions. |
DraftApi | get_draft | GET /draft | Get round-by-round data for current year's NHL Entry Draft. |
DraftApi | get_draft_by_year | GET /draft/{year} | Get round-by-round data for a specific year's NHL Entry Draft. |
DraftApi | get_draft_prospect | GET /draft/prospects/{id} | Get an NHL Entry Draft prospect. |
DraftApi | get_draft_prospects | GET /draft/prospects | Get all NHL Entry Draft prospects. |
GamesApi | get_game | GET /game/{id}/feed/live | Get all available data for an NHL game. |
GamesApi | get_game_boxscore | GET /game/{id}/boxscore | Get the boxscore for an NHL game. |
GamesApi | get_game_content | GET /game/{id}/content | Get editorials, video replays and photo highlights for an NHL game. |
GamesApi | get_game_diff | GET /game/{id}/feed/live/diffPatch | Get all available data for an NHL game after a specific time. |
PlayersApi | get_player | GET /people/{id} | Get an NHL player. |
PlayersApi | get_player_stats | GET /people/{id}/stats | Get specific statistics for an NHL player. |
ScheduleApi | get_schedule | GET /schedule | Get the NHL game schedule. |
StandingsApi | get_standing_types | GET /standingsTypes | Get all available NHL standing types. |
StandingsApi | get_standings | GET /standings | Get NHL division standings. |
StandingsApi | get_standings_by_type | GET /standings/{type} | Get NHL standings for a specific standing type. |
StatsApi | get_stat_types | GET /statTypes | Get all available NHL statistic types. |
TeamsApi | get_team | GET /teams/{id} | Get an NHL team. |
TeamsApi | get_team_roster | GET /teams/{id}/roster | Get an NHL team's roster. |
TeamsApi | get_team_stats | GET /teams/{id}/stats | Get all statistics for an NHL team. |
TeamsApi | get_teams | GET /teams | Get all NHL teams. |
Documentation For Models
- AnyOfGameContentMediaEpgItems
- Conference
- Conferences
- Division
- DivisionConference
- Divisions
- Draft
- DraftDrafts
- DraftPicks
- DraftProspect
- DraftProspectAmateurLeague
- DraftProspectAmateurTeam
- DraftProspectPrimaryPosition
- DraftProspectProspectCategory
- DraftProspects
- DraftRounds
- DraftTeam
- Error
- Franchise
- Game
- GameBoxscore
- GameBoxscoreTeam
- GameBoxscoreTeamCoaches
- GameBoxscoreTeamOnIcePlus
- GameBoxscoreTeamPerson
- GameBoxscoreTeamPlayers
- GameBoxscoreTeamPlayersPerson
- GameBoxscoreTeamPlayersPosition
- GameBoxscoreTeamPlayersStats
- GameBoxscoreTeamPlayersStatsSkaterStats
- GameBoxscoreTeamPosition
- GameBoxscoreTeamTeam
- GameBoxscoreTeamTeamStats
- GameBoxscoreTeamTeamStatsTeamSkaterStats
- GameBoxscoreTeams
- GameBoxscores
- GameContent
- GameContentEditorial
- GameContentHighlights
- GameContentMedia
- GameContentMediaMilestones
- GameContentMediaMilestonesItems
- GameDecisionPlayer
- GameEditorial
- GameEditorialContributor
- GameEditorialContributorContributors
- GameEditorialKeyword
- GameEditorialMedia
- GameEditorialTokenData
- GameEditorials
- GameGameData
- GameGameDataDatetime
- GameGameDataGame
- GameGameDataStatus
- GameGameDataTeams
- GameGameDataVenue
- GameHighlight
- GameHighlightPlaybacks
- GameHighlightType
- GameHighlights
- GameLinescore
- GameLinescoreIntermissionInfo
- GameLinescorePowerPlayInfo
- GameLinescoreShootoutInfo
- GameLinescoreShootoutInfoAway
- GameLinescoreTeam
- GameLinescoreTeams
- GameLiveData
- GameLiveDataDecisions
- GameLiveDataPlays
- GameLiveDataPlaysPlaysByPeriod
- GameMediaAudio
- GameMediaAudioItems
- GameMediaNHLTV
- GameMediaNHLTVItems
- GameMetaData
- GameOfficial
- GameOfficialOfficial
- GamePeriod
- GamePeriodAway
- GamePeriodHome
- GamePlay
- GamePlayAbout
- GamePlayAboutGoals
- GamePlayCoordinates
- GamePlayPlayer
- GamePlayPlayers
- GamePlayResult
- GamePlayTeam
- Photo
- PhotoCuts
- Player
- PlayerCurrentTeam
- PlayerStats
- PlayerStatsOpponentDivision
- PlayerStatsSplits
- PlayerStatsStat
- PlayerStatsStats
- PlayerStatsType
- Players
- Roster
- RosterPerson
- Rosters
- Schedule
- ScheduleDay
- ScheduleGame
- ScheduleGameContent
- ScheduleGameTeams
- ScheduleGameTeamsAway
- ScheduleGameTeamsAwayLeagueRecord
- ScheduleGameTeamsAwayTeam
- ScheduleGameTeamsHome
- ScheduleGameTeamsHomeLeagueRecord
- ScheduleGameTickets
- StandingTypes
- StandingTypesInner
- Standings
- StandingsDivision
- StandingsLeague
- StandingsRecords
- StandingsStreak
- StandingsTeamRecords
- StatTypes
- StatTypesInner
- Team
- TeamNextGameSchedule
- TeamNextGameScheduleDates
- TeamNextGameScheduleGames
- TeamNextGameScheduleStatus
- TeamNextGameScheduleTeams
- TeamNextGameScheduleTeamsAway
- TeamNextGameScheduleTeamsAwayLeagueRecord
- TeamNextGameScheduleTeamsAwayTeam
- TeamNextGameScheduleTeamsHome
- TeamNextGameScheduleTeamsHomeLeagueRecord
- TeamRoster
- TeamStats
- TeamStatsSplits
- TeamStatsStat
- TeamStatsStats
- TeamStatsType
- Teams
- Venue
- VenueTimeZone
Documentation For Authorization
All endpoints do not require authorization.
Our Authors
Citations
To cite the powerplay
Python package in publications, use:
BibTex Citation
@misc{saiemgilani2021powerplay,
author = {Gilani, Saiem},
title = {powerplay: The SportsDataverse Package for Hockey Data.},
url = {https://powerplay-py.sportsdataverse.org},
season = {2021}
}
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
Built Distribution
File details
Details for the file powerplay-0.0.1.tar.gz
.
File metadata
- Download URL: powerplay-0.0.1.tar.gz
- Upload date:
- Size: 104.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ccdca97c7aa6f0d67afd763e03945d4c085415a40c0b0879fc54cec969f56e9 |
|
MD5 | 226c7245196cf1382a3c25c326af2dc7 |
|
BLAKE2b-256 | b4b96033bd9d7fa75b81adcd1756e14468b0c777974ddeae46f85d857a3b7a40 |
File details
Details for the file powerplay-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: powerplay-0.0.1-py3-none-any.whl
- Upload date:
- Size: 347.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 691898f9682ffeec9b010bcd13f6c54f40b54ad4b6a1bdca77a9d1a1824ae91d |
|
MD5 | 9215c3356f10db863e8bafa09db22bb3 |
|
BLAKE2b-256 | 1932e208ffca317065bdb57b57e772ef81eda5e393c4880b9ea8bcb209656010 |