Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug Fix: Double URL Encoding in Stats APIs #73

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -373,3 +373,27 @@ $ ruff .
$ black .

```


#### Poetry version management
```
# View current version
poetry version
# Bump version
poetry version patch # 0.1.0 -> 0.1.1
poetry version minor # 0.1.0 -> 0.2.0
poetry version major # 0.1.0 -> 1.0.0
# Set specific version
poetry version 2.0.0
# Set pre-release versions
poetry version prepatch # 0.1.0 -> 0.1.1-alpha.0
poetry version preminor # 0.1.0 -> 0.2.0-alpha.0
poetry version premajor # 0.1.0 -> 1.0.0-alpha.0
# Specify pre-release identifier
poetry version prerelease # 0.1.0 -> 0.1.0-alpha.0
poetry version prerelease beta # 0.1.0-alpha.0 -> 0.1.0-beta.0
```
3 changes: 0 additions & 3 deletions nhlpy/_version.py

This file was deleted.

4 changes: 2 additions & 2 deletions nhlpy/api/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def skater_stats_with_query_context(
penaltykill, penaltyShots, powerplay, puckPossessions, summaryshooting, percentages, scoringRates,
scoringpergame, shootout, shottype, timeonice
:param query_context:
:param aggregate: bool - If doing multiple years, you can choose to aggreate the date per player,
:param aggregate: bool - If doing multiple years, you can choose to aggregate the date per player,
or have separate entries for each one.
:param sort_expr: A list of key/value pairs for sort criteria. As used in skater_stats_summary(), this is
in the format:
Expand All @@ -269,7 +269,7 @@ def skater_stats_with_query_context(
if not sort_expr:
sort_expr = SortingOptions.get_default_sorting_for_report(report_type)

q_params["sort"] = urllib.parse.quote(json.dumps(sort_expr))
q_params["sort"] = json.dumps(sort_expr)
q_params["cayenneExp"] = query_context.query_str
return self.client.get_by_url(
f"https://api.nhle.com/stats/rest/en/skater/{report_type}", query_params=q_params
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "poetry.core.masonry.api"

[tool.poetry]
name = "nhl-api-py"
version = "2.11.0"
version = "2.11.1"
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."
authors = ["Corey Schaf <[email protected]>"]
readme = "README.md"
Expand Down
Loading