Skip to main content

Get all NBA player data into JSON format

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nba_player-0.6.8.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

nba_player-0.6.8-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file nba_player-0.6.8.tar.gz.

File metadata

  • Download URL: nba_player-0.6.8.tar.gz
  • Upload date:
  • Size: 6.1 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for nba_player-0.6.8.tar.gz
Algorithm Hash digest
SHA256 35eed9e1f103beabcc6e00cfa031866d1506387cecfbbbc953b1dccf04441570
MD5 5df9957852231a49328ff0eaccdd44b2
BLAKE2b-256 c01ecb014a576681ce52047361281e60d367d073c11a9c9e8d31af6c5f777fd6

See more details on using hashes here.

File details

Details for the file nba_player-0.6.8-py3-none-any.whl.

File metadata

  • Download URL: nba_player-0.6.8-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for nba_player-0.6.8-py3-none-any.whl
Algorithm Hash digest
SHA256 717e07e65590b890ac72c91cf1512ed513a7644afee35032e91d6c95a16b3138
MD5 6c3c14a49a933dfe4a6222b2a128e3ad
BLAKE2b-256 f50fc70e21cbffd45e4ffe326ccd60add2830c3944c218c133c5264b079da079

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page