-
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* added optional date to score_now() for checking the next days scores before noon * added playoff endpoints --------- Co-authored-by: Corey Schaf <[email protected]> Co-authored-by: User Name <[email protected]>
- Loading branch information
1 parent
968d20c
commit 47e8cab
Showing
2 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from nhlpy.http_client import HttpClient | ||
|
||
|
||
class Playoff: | ||
def __init__(self, http_client: HttpClient): | ||
self.client = http_client | ||
|
||
def carousel(self, season: str) -> dict: | ||
""" | ||
Get the list of all series games. Currently only | ||
shows Round 1 games | ||
:param season: the current season ex. "20232024" | ||
example: | ||
https://api-web.nhle.com/v1/playoff-series/carousel/20232024/ | ||
:return: dict | ||
""" | ||
return self.client.get(resource=f"playoff-series/carousel/{season}").json() | ||
|
||
def schedule(self, season: str, series: str) -> dict: | ||
""" | ||
Returns the schedule for a specified series. | ||
:param season: the the season you wish to see the schedule of | ||
:param series: the series (a-h) for Round 1 | ||
example: | ||
https://api-web.nhle.com/v1/schedule/playoff-series/20232024/a/ | ||
:return: dict | ||
""" | ||
|
||
return self.client.get(resource=f"schedule/playoff-series/{season}/{series}").json() | ||
|
||
def bracket(self, year: str) -> dict: | ||
""" | ||
Returns the playoff bracket | ||
:param year: the year the playoffs are taking place ex. "2024" | ||
example: | ||
https://api-web.nhle.com/v1/playoff-bracket/2024 | ||
:return: dict | ||
""" | ||
|
||
return self.client.get(resource=f"playoff-bracket/{year}").json() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters