Skip to main content

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)

Source distribution for nba-player 0.6.8
File Size Uploaded
nba_player-0.6.8.tar.gz 6.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for nba-player 0.6.8
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

0.6.8 This release

2 release files

0.6.7

2 release files

0.6.6

2 release files

0.6.4

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6

2 release files

0.5.6

2 release files

0.5.5

2 release files

0.5.3

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4

2 release files

0.3.1

2 release files

0.3

2 release files

0.2.1

2 release files

0.2

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page