Create and update your own database of National Basketball Association (NBA) player box score statistics
Creating
Updating
Querying
SELECT * FROM player_reg_season
WHERE season_id LIKE '%2017'
AND player_name = 'Stephen Curry'
Do the following in a command line:
pip install requests
pip install pandas
pip install nba_py
The nba_db_presets.py file has two items that can be changed:
- Database start year
- Name of database file
I do not recommend you modify the start year because certain stats from before 1984 are missing and incomplete
# Create database starting with the year Micheal Jordan got drafted, the 1984-85 season
db_start_year = 1984
# Query up to the current year
now = datetime.datetime.now()
current_year = now.year
# Name of database file
database_name = 'nba.db'
@klane Special thanks to https://klane.github.io/databall1/data/wrangling/ for being a great starting point and reference
@seemethere And of course to https://github.com/seemethere/nba_py for creating the python API
By default, the script downloads raw player stat boxscores. Using these boxscores, additional advanced stats and team stats can be calculated on your own