nhl-api-py 2.2.5__tar.gz → 2.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nhl-api-py
3
- Version: 2.2.5
3
+ Version: 2.2.6
4
4
  Summary: NHL API. For standings, team stats, outcomes, player information. Contains each individual API endpoint as well as convience methods for easy data loading in Pandas or any ML applications.
5
5
  Home-page: https://github.com/coreyjs/nhl-api-py
6
6
  License: GPL-3.0-or-later
@@ -60,9 +60,9 @@ client = NHLClient(verbose=True) # a tad more logging such as the URL being call
60
60
 
61
61
  ```python
62
62
 
63
- client.club_stats_season(team_abbr="BUF") # kinda weird endpoint.
63
+ client.stats.club_stats_season(team_abbr="BUF") # kinda weird endpoint.
64
64
 
65
- client.player_career_stats(player_id=8478402)
65
+ client.stats.player_career_stats(player_id="8478402")
66
66
 
67
67
  # Team Summary Stats.
68
68
  # These have lots of available parameters. You can also tap into the apache cayenne expressions to build custom
@@ -34,9 +34,9 @@ client = NHLClient(verbose=True) # a tad more logging such as the URL being call
34
34
 
35
35
  ```python
36
36
 
37
- client.club_stats_season(team_abbr="BUF") # kinda weird endpoint.
37
+ client.stats.club_stats_season(team_abbr="BUF") # kinda weird endpoint.
38
38
 
39
- client.player_career_stats(player_id=8478402)
39
+ client.stats.player_career_stats(player_id="8478402")
40
40
 
41
41
  # Team Summary Stats.
42
42
  # These have lots of available parameters. You can also tap into the apache cayenne expressions to build custom
@@ -1,3 +1,3 @@
1
1
  # Should this be driven by the main pyproject.toml file? yes, is it super convoluted? yes, can it wait? sure
2
2
 
3
- __version__ = "2.2.5"
3
+ __version__ = "2.2.6"
@@ -18,7 +18,7 @@ class Stats:
18
18
  """
19
19
  return self.client.get(resource=f"club-stats-season/{team_abbr}").json()
20
20
 
21
- def player_career_stats(self, player_id: int) -> dict:
21
+ def player_career_stats(self, player_id: str) -> dict:
22
22
  """
23
23
  This returns the career stats for a player as well as player information.
24
24
 
@@ -29,6 +29,16 @@ class Stats:
29
29
  """
30
30
  return self.client.get(resource=f"player/{player_id}/landing").json()
31
31
 
32
+ def player_game_log(self, player_id: str, season_id: str, game_type: int) -> List[dict]:
33
+ """
34
+ Returns the game log, for the given player, for the given season and game type.
35
+ :param game_type: 1 is for preseason, 2 is for regular season, 3 is for playoffs.
36
+ :param season_id: Season format of "20222023", "20232024", etc.
37
+ :param player_id:
38
+ :return:
39
+ """
40
+ return self.client.get(resource=f"player/{player_id}/game-log/{season_id}/{game_type}").json()["gameLog"]
41
+
32
42
  def team_summary(
33
43
  self,
34
44
  start_season: str,
@@ -95,7 +105,7 @@ class Stats:
95
105
  self,
96
106
  start_season: str,
97
107
  end_season: str,
98
- franchise_id: int = None,
108
+ franchise_id: str = None,
99
109
  game_type_id: int = 2,
100
110
  aggregate: bool = False,
101
111
  sort_expr: List[dict] = None,
@@ -109,7 +119,7 @@ class Stats:
109
119
  c.stats.skater_stats_summary(franchise_id=10, start_season="20232024", end_season="20232024")
110
120
  :param start_season: Season id, in format 20202021, 20212022, etc, that will be the start of the range.
111
121
  :param end_season: Season id for the end range.
112
- :param franchise_id: The ID of the franchise. Not to be confused with team_id found on other endpoints.
122
+ :param franchise_id: String, The ID of the franchise. Not to be confused with team_id found on other endpoints.
113
123
  This seems to be specific to the /stats apis.
114
124
  :param game_type_id: 2 is for regular season, 3 is for playoffs. I think 1 is for preseason.
115
125
  :param aggregate: If doing multiple years, you can choose to aggreate the date per player, or have separate
@@ -2,4 +2,5 @@ class ClientConfig:
2
2
  def __init__(self, verbose: bool = False) -> None:
3
3
  self.verbose = verbose
4
4
  self.api_web_base_url = "https://api-web.nhle.com"
5
+ self.api_base_url = "https://api.nhle.com"
5
6
  self.api_web_api_ver = "/v1/"
@@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "nhl-api-py"
7
- version = "2.2.5"
7
+ version = "2.2.6"
8
8
  description = "NHL API. For standings, team stats, outcomes, player information. Contains each individual API endpoint as well as convience methods for easy data loading in Pandas or any ML applications."
9
9
  authors = ["Corey Schaf <cschaf@gmail.com>"]
10
10
  readme = "README.md"
File without changes
File without changes