Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Tip
Review commit-by-commit!
This PR tackles adding static WNBA data, sparked by the discussion here (#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
andWnbaSeason
classes in order to get theCommonAllPlayers
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
andsrc/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 🙏.