nba_api
nba_api copied to clipboard
Add WNBA static data.
[!TIP] Review commit-by-commit!
This PR tackles adding static WNBA data, sparked by the discussion here (https://github.com/swar/nba_api/issues/439).
The general approach taken is to update the /tools/stats/static_players_update/update.py
to also fetch and write WNBA players in addition to the existing NBA players. The WNBA teams data was manually populated, since I didn't see a corresponding workflow for teams. There's only 12 teams so this wasn't so bad.
I did have to introduce WnbaSeasonYear
and WnbaSeason
classes in order to get the CommonAllPlayers
endpoint to work correctly when fetching WNBA data. The issue was that WNBA seasons are a single year (e.g "2024" instead of "2023-2024").
Also updated src/nba_api/stats/static/teams.py
and src/nba_api/stats/static/players.py
to support WNBA static data. I refactored these files slightly so that both the NBA and WNBA interfaces can use the same underlying functions.
Added to existing documentation. Didn't write too many tests other than the one unit test I could see that existed - LMK if I should write more.
There should be no breaking changes.
Please let me know how this looks! Happy to revise as necessary 🙏.