NBA Player Data into JSON
Installation
pip install nba-player
Usage
import datanba
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 players variable.
Release files for nba-player 0.6.8
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nba_player-0.6.8.tar.gz | 6.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nba_player-0.6.8-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.8 kB
Release files / nba_player-0.6.8.tar.gz
| Download URL | nba_player-0.6.8.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
35eed9e1f103beabcc6e00cfa031866d1506387cecfbbbc953b1dccf04441570
|
|
BLAKE2b-256 checksum How to use checksums |
c01ecb014a576681ce52047361281e60d367d073c11a9c9e8d31af6c5f777fd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.4
|
Release files / nba_player-0.6.8-py3-none-any.whl
| Download URL | nba_player-0.6.8-py3-none-any.whl |
|---|---|
| Size | 11.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
717e07e65590b890ac72c91cf1512ed513a7644afee35032e91d6c95a16b3138
|
|
BLAKE2b-256 checksum How to use checksums |
f50fc70e21cbffd45e4ffe326ccd60add2830c3944c218c133c5264b079da079
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.23.4 CPython/3.6.4
|