nhl-api-py 3.0.0__tar.gz → 3.0.2__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.
Files changed (36) hide show
  1. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/PKG-INFO +2 -2
  2. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/http_client.py +14 -3
  3. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/pyproject.toml +2 -2
  4. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/README.md +0 -0
  5. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/__init__.py +0 -0
  6. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/__init__.py +0 -0
  7. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/game_center.py +0 -0
  8. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/helpers.py +0 -0
  9. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/misc.py +0 -0
  10. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/players.py +0 -0
  11. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/__init__.py +0 -0
  12. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/builder.py +0 -0
  13. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/__init__.py +0 -0
  14. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/decision.py +0 -0
  15. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/draft.py +0 -0
  16. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/experience.py +0 -0
  17. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/franchise.py +0 -0
  18. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/game_type.py +0 -0
  19. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/home_road.py +0 -0
  20. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/nationality.py +0 -0
  21. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/opponent.py +0 -0
  22. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/position.py +0 -0
  23. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/season.py +0 -0
  24. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/shoot_catch.py +0 -0
  25. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/filters/status.py +0 -0
  26. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/sorting/__init__.py +0 -0
  27. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/query/sorting/sorting_options.py +0 -0
  28. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/schedule.py +0 -0
  29. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/standings.py +0 -0
  30. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/stats.py +0 -0
  31. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/api/teams.py +0 -0
  32. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/config.py +0 -0
  33. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/data/seasonal_information_manifest.json +0 -0
  34. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/data/team_stat_ids.json +0 -0
  35. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/data/teams_20232024.json +0 -0
  36. {nhl_api_py-3.0.0 → nhl_api_py-3.0.2}/nhlpy/nhl_client.py +0 -0
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nhl-api-py
3
- Version: 3.0.0
4
- Summary: NHL API (Updated for 2024/2025) and EDGE Stats. For standings, team stats, outcomes, player information. Contains each individual API endpoint as well as convience methods as well as pythonic query builder for more indepth EDGE stats.
3
+ Version: 3.0.2
4
+ Summary: NHL API (Updated for 2025/2026) and EDGE Stats. For standings, team stats, outcomes, player information. Contains each individual API endpoint as well as convience methods as well as pythonic query builder for more indepth EDGE stats.
5
5
  Home-page: https://github.com/coreyjs/nhl-api-py
6
6
  License: GPL-3.0-or-later
7
7
  Keywords: nhl,api,wrapper,hockey,sports,edge,edge stats,edge analytics,edge sports,edge hockey,edge nhl,edge nhl stats,edge nhl analytics,edge nhl sports,edge nhl hockey,edge nhl data,edge nhl data analytics,edge nhl data stats,edge nhl data sports,edge nhl data hockey,edge nhl data stats analytics,edge nhl data stats sports,edge nhl data stats hockey,hockey ai,hockey machine learning,nhl ML,nhl AI,nhl machine learning,nhl stats,nhl analytics,nhl sports,nhl hockey,nhl nhl,nhl nhl stats,nhl nhl analytics,nhl nhl sports,edge nhl data hockey stats
@@ -69,10 +69,16 @@ class UnauthorizedException(NHLApiException):
69
69
  class HttpClient:
70
70
  def __init__(self, config) -> None:
71
71
  self._config = config
72
+ self._logger = logging.getLogger(__name__)
72
73
  if self._config.debug:
73
- logging.basicConfig(level=logging.DEBUG)
74
+ self._logger.setLevel(logging.DEBUG)
75
+ if not self._logger.handlers:
76
+ handler = logging.StreamHandler()
77
+ formatter = logging.Formatter("%(name)s - %(levelname)s - %(message)s")
78
+ handler.setFormatter(formatter)
79
+ self._logger.addHandler(handler)
74
80
  else:
75
- logging.basicConfig(level=logging.WARNING)
81
+ self._logger.setLevel(logging.WARNING)
76
82
 
77
83
  def _handle_response(self, response: httpx.Response, url: str) -> None:
78
84
  """Handle different HTTP status codes and raise appropriate exceptions"""
@@ -108,6 +114,8 @@ class HttpClient:
108
114
  def get(self, endpoint: Endpoint, resource: str, query_params: dict = None) -> httpx.Response:
109
115
  """
110
116
  Private method to make a get request to the NHL API. This wraps the lib httpx functionality.
117
+ :param query_params:
118
+ :param endpoint:
111
119
  :param resource:
112
120
  :return: httpx.Response
113
121
  :raises:
@@ -124,7 +132,10 @@ class HttpClient:
124
132
  with httpx.Client(
125
133
  verify=self._config.ssl_verify, timeout=self._config.timeout, follow_redirects=self._config.follow_redirects
126
134
  ) as client:
127
- r: httpx.Response = client.get(url=f"{endpoint.value}{resource}", params=query_params)
135
+ full_url = f"{endpoint.value}{resource}"
136
+ if self._config.debug:
137
+ self._logger.debug(f"GET: {full_url}")
138
+ r: httpx.Response = client.get(url=full_url, params=query_params)
128
139
 
129
140
  self._handle_response(r, resource)
130
141
  return r
@@ -4,8 +4,8 @@ build-backend = "poetry.core.masonry.api"
4
4
 
5
5
  [tool.poetry]
6
6
  name = "nhl-api-py"
7
- version = "3.0.0"
8
- description = "NHL API (Updated for 2024/2025) and EDGE Stats. For standings, team stats, outcomes, player information. Contains each individual API endpoint as well as convience methods as well as pythonic query builder for more indepth EDGE stats."
7
+ version = "3.0.2"
8
+ description = "NHL API (Updated for 2025/2026) and EDGE Stats. For standings, team stats, outcomes, player information. Contains each individual API endpoint as well as convience methods as well as pythonic query builder for more indepth EDGE stats."
9
9
  authors = ["Corey Schaf <cschaf@gmail.com>"]
10
10
  readme = "README.md"
11
11
  packages = [{include = "nhlpy"}]
File without changes
File without changes
File without changes
File without changes