Skip to content

milanify/nba-database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nba-database

Create and update your own database of National Basketball Association (NBA) player box score statistics

Preview

Creating

alt tag

Updating

alt tag

Querying

SELECT * FROM player_reg_season
	WHERE season_id LIKE '%2017'
	AND player_name = 'Stephen Curry'

alt tag

Requirements/Dependencies

Do the following in a command line:

pip install requests
pip install pandas
pip install nba_py

Instructions for Modifying Presets

The nba_db_presets.py file has two items that can be changed:

  1. Database start year
  2. 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'

Notes

@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

Releases

No releases published

Packages

No packages published

Languages