Fetch PWHL game schedules from the HockeyTech API
Project description
pwhl-client
Fetch PWHL game schedules from the HockeyTech API. A Python library and CLI tool for developers who want structured, validated schedule data from the Professional Women's Hockey League without dealing with raw API responses.
Install
pip install pwhl-client
Quick start — library
Single date (defaults to today):
from pwhl_client import get_schedule
games = get_schedule()
print(games.to_dict())
Specific date:
from datetime import date
from pwhl_client import get_schedule
games = get_schedule(start=date(2026, 3, 15))
print(games.to_dict())
Date range with timezone:
from datetime import date
from zoneinfo import ZoneInfo
from pwhl_client import get_schedule
games = get_schedule(
start=date(2026, 3, 15),
end=date(2026, 3, 22),
tz=ZoneInfo("America/New_York"),
)
for game in games.games:
print(game.home_team, "vs", game.visiting_team, "@", game.game_datetime)
Quick start — CLI
# Today's games
pwhl-client
# Specific date
pwhl-client 2026-03-15
# Specific date with timezone
pwhl-client 2026-03-15 --tz America/New_York
Configuration
PWHL_API_KEY defaults to the current known public value embedded in the PWHL website's JavaScript. You only need to set it if the key rotates.
# .env file (recommended)
PWHL_API_KEY=your_new_key_here
# or shell export
export PWHL_API_KEY=your_new_key_here
PWHL_CLIENT_CODE is hardcoded as "pwhl" — it is a fixed league identifier on the HockeyTech platform and is not user-configurable.
Output shape
ScheduleResult.to_dict() returns:
{
"fetched_at": "2026-03-15T19:00:00+00:00",
"game_count": 1,
"games": [
{
"game_id": "12345",
"game_status": "scheduled",
"home_team": "Boston Fleet",
"home_team_id": "1",
"visiting_team": "Minnesota Frost",
"visiting_team_id": "2",
"venue": "Tsongas Center",
"city": "Lowell",
"game_datetime": "2026-03-15T19:00:00-04:00",
"home_goal_count": null,
"visiting_goal_count": null
}
]
}
game_status is one of "scheduled", "in_progress", "completed", or "unknown".
game_datetime is always timezone-aware and stored in the timezone passed to get_schedule().
home_goal_count and visiting_goal_count are null for pre-game entries.
Exceptions
pwhl-client raises the following exceptions:
PWHLAPIError— raised on network failure, timeout, or a non-2xx HTTP response from the HockeyTech API.PWHLParseError(subclass ofPWHLAPIError) — raised when the API returns a response that cannot be parsed or does not match the expected shape.ValueError— raised whenstartis afterend.
Catch PWHLAPIError to handle both API and parse failures in one place:
from pwhl_client import get_schedule, PWHLAPIError
try:
result = get_schedule()
except PWHLAPIError as e:
print(f"Could not fetch schedule: {e}")
Data source
Game data is fetched from the HockeyTech/LeagueStat API, the undocumented backend that powers thepwhl.com. The API has been reverse-engineered and documented by the community — see the PWHL Data Reference repository for full details on available endpoints and parameters.
License
MIT
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pwhl_client-0.1.0.tar.gz.
File metadata
- Download URL: pwhl_client-0.1.0.tar.gz
- Upload date:
- Size: 13.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4896a29580cef7ce6191b7a1c61959727e2dd5f1b9d47192ddf150ad0c9c0d72
|
|
| MD5 |
2401bd2ee5fac233b8e335addbe96572
|
|
| BLAKE2b-256 |
f6865082e9976ab6b5241ed33b8c1297919e80fc65e19575aa7c065bf2cb302b
|
Provenance
The following attestation bundles were made for pwhl_client-0.1.0.tar.gz:
Publisher:
publish.yml on jgalloway42/pwhl-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pwhl_client-0.1.0.tar.gz -
Subject digest:
4896a29580cef7ce6191b7a1c61959727e2dd5f1b9d47192ddf150ad0c9c0d72 - Sigstore transparency entry: 1109929161
- Sigstore integration time:
-
Permalink:
jgalloway42/pwhl-client@b80006e2613155a3c4601a74813cc6503e0965e4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jgalloway42
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b80006e2613155a3c4601a74813cc6503e0965e4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pwhl_client-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pwhl_client-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8de418b46a64e9d5b4bd4bc18995c0bf0b153f3aeba1daf7223e1abf6c425edf
|
|
| MD5 |
5080acc5122018f6859107fbc36f1eee
|
|
| BLAKE2b-256 |
c8079671fa77afbd145a6b4d347565414ea2940acb3b610bf5ae24bd388ba2ac
|
Provenance
The following attestation bundles were made for pwhl_client-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on jgalloway42/pwhl-client
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pwhl_client-0.1.0-py3-none-any.whl -
Subject digest:
8de418b46a64e9d5b4bd4bc18995c0bf0b153f3aeba1daf7223e1abf6c425edf - Sigstore transparency entry: 1109929200
- Sigstore integration time:
-
Permalink:
jgalloway42/pwhl-client@b80006e2613155a3c4601a74813cc6503e0965e4 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/jgalloway42
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b80006e2613155a3c4601a74813cc6503e0965e4 -
Trigger Event:
push
-
Statement type: