An API Client package to access the APIs for thepwhl.com
Project description
pwhl_api
An API Client Package to Access the APIs of thepwhl.com
pwhl_api is a client for APIs used by thepwhl.com to retrieve statistics for PWHL league teams and personnel.
This client is based on the work done by Swar Patel and other contributors on nba_api, a similar package for endpoints on nba.com. Further, in the process of creating endpoints for this client, Isabelle Lefebvre's write-up regarding the https://lscluster.hockeytech.com/feed/ endpoints used on the PWHL site was used for identification and validation.
Getting Started
pwhl_api requires Python version 3.10 or higher, and can be installed through pip using the following command:
pip install pwhl_api
Getting Static Team Information
# Getting team information by id
from pwhl_api.static.teams import get_team, get_team_by_name
get_team("2")
Expected output:
{'id': '2',
'name': 'Minnesota Frost',
'nickname': 'Frost',
'team_code': 'MIN',
'division_id': '1',
'logo': 'https://assets.leaguestat.com/pwhl/logos/50x50/2.png'}
# Getting team information by name
get_team_by_name("Boston Fleet")
Expected output:
{'id': '1',
'name': 'Boston Fleet',
'nickname': 'Fleet',
'team_code': 'BOS',
'division_id': '1',
'logo': 'https://assets.leaguestat.com/pwhl/logos/50x50/1.png'}
Retrieving Team Rosters
from pwhl_api.endpoints.teamroster import TeamRoster
roster = TeamRoster(team_id="2", season="8") # team: Minnesota Frost, season: 2025-26 Regular
roster_dfs = roster.get_data_frames()
roster_dfs['Forwards'].head(5)
shoots hometown player_id birthdate tp_jersey_number position \
0 R Mississauga, ON 265 2001-03-02 3 F
1 R Amherst, NY 191 2001-01-16 6 F
2 R Andover, MN 102 1999-09-24 7 F
3 R Atlanta, GA 194 2001-09-20 11 F
4 R Plymouth, MN 23 1995-12-29 12 F
name
0 Alyssa Machado
1 Katy Knoll
2 Claire Butorac
3 Kaitlyn O'Donohoe
4 Kelly Pannek
Documentation
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_api-0.1.2.tar.gz.
File metadata
- Download URL: pwhl_api-0.1.2.tar.gz
- Upload date:
- Size: 22.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1eaa0e9e8cc6caf1722062be3c074222e9d2bed777f15f19154f37df50c4f394
|
|
| MD5 |
08307e301060885829f1e3dad32ea3bf
|
|
| BLAKE2b-256 |
5a804177ff92900a7f94fe02972ed1b7b0e52644affe24ba9f164792abb83781
|
File details
Details for the file pwhl_api-0.1.2-py3-none-any.whl.
File metadata
- Download URL: pwhl_api-0.1.2-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
323180e8d423d6ac7cd0502caf4f8471da007604b841ed5603cd9852f1173200
|
|
| MD5 |
0cbc566597fbdfad4e357ddfdfcfda5b
|
|
| BLAKE2b-256 |
8639a074c0c2f4fb42d25856aeb7580fcfe1bb4852f34279f88af6deb3abf289
|