A nba stats client
Thus, due to these contraints this client is only as dependable and consistent as the NBA Stats service.
Additionally, this client is by no means complete, and will be in active development.
Client API Details
This project is available on PyPi.
pip install nba_data
- get_players_for_season(season, league=League.nba, current_season_only=CurrentSeasonOnly.yes)
- get_games_for_team(season, team, season_type=SeasonType.regular_season)
API Method Parameters
- season: A Season enum value. Represents the specific season to query for.
- league: A League enum value. Generally speaking, will always want to use League.nba.
- current_season_only: A CurrentSeasonOnly enum value. When yes, disregards the sesaon parameter and returns all players across all seasons
- season_type: A SeasonType enum value that represents which section of a season to query (regular season, playoffs, etc.)
- player_id: The unique id that NBA Stats assigns to each player.
- game_id: The unique id that NBA Stats assigns to each game.
Get Players For Season
from nba_data import Client from nba_data import CurrentSeasonOnly from nba_data import Season def get_players_for_2015_season(): return Client.get_players_for_season(season=Season.season_2015) def get_players_for_every_season(): return Client.get_players_for_season(season=Season.season_2015, current_season_only=CurrentSeasonOnly.no)