Get all NBA player data into JSON format
NBA Player Data into JSON
pip install nba-player
Get All Players
data = datanba.player_stats.AllOfBasketball(arr)
arr is the years that you want in the normal year format for NBA (i.e ["2018-19"])
To get all player data into JSON
data = datanba.player_stats.AllOfBasketball(["2018-19"]) data.gather("players.json", exists=False)
Only use this if you have nothing in your players.json file or it does not exist at all.
However, since you will be polling a lot, you might have your connection work or the NBA stats API will limit you, so if scraping stops in the middle, you can change your code to:
data = datanba.player_stats.AllOfBasketball(["2018-19"]) data.gather("players.json", exists=True)
Then, scraping will continue from where it left off.
Use Player JSON data
After polling once, you can reuse the output form the JSON file as long as you would like(until the data that you have polled has become old), by using these commands.
import datanba.player_stats as datanba data = datanba.AllOfBasketball(["2018-19"]) players = data.players_from_json('players.json')
Now you have all NBA players in your
Release history Release notifications
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size nba_player-0.6.8-py3-none-any.whl (11.7 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size nba_player-0.6.8.tar.gz (6.1 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for nba_player-0.6.8-py3-none-any.whl