Skip to main content

A Python client for scraping stats and data from Basketball Reference

Project description

basketball_reference_scraper

Basketball Reference is a great resource to aggregate statistics on NBA teams, seasons, players, and games. This package provides methods to acquire data for all these categories in pre-parsed and simplified formats.

Installing

Via pip

I wrote this library as an exercise for creating my first PyPi package. Hopefully, you find it easy to use. Install using the following command:

pip install basketball-reference-scraper==v1.0.4

Via GitHub

Alternatively, you can just clone this repo and import the libraries at your own discretion.

Wait, don't scrapers like this already exist?

Yes, scrapers and APIs do exist. The primary API used currently is for stats.nba.com, but the website blocks too many requests, hindering those who want to acquire a lot of data. Additionally, scrapers for Basketball Reference do exist, but none of them load dynamically rendered content. These scrapers can only acquire statically loaded content, preventing those who want statistics in certain formats (for example, Player Advanced Stats Per Game).

API

Currently, the package contains 5 modules: teams, players, seasons, box_scores, pbp, shot_charts, and injury_report. The package will be expanding to include other content as well, but this is a start.

For full details on the API please refer to the documentation.

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

basketball_reference_scraper-1.0.5.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file basketball_reference_scraper-1.0.5.tar.gz.

File metadata

  • Download URL: basketball_reference_scraper-1.0.5.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for basketball_reference_scraper-1.0.5.tar.gz
Algorithm Hash digest
SHA256 8f04ed6654d32b9e845e64dd2e333ecedbd86cfeb9bf017162e24b8d807672e8
MD5 3117c37b23305a6b13f728bb76944677
BLAKE2b-256 3dfa5fe2e3b525c125bc5691e22a47f163685f1b10e43fbcaeafb78a05ee4091

See more details on using hashes here.

File details

Details for the file basketball_reference_scraper-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: basketball_reference_scraper-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 16.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.6

File hashes

Hashes for basketball_reference_scraper-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 e60d7318fd2d5c5893165fd0dc6a6e88e95c53f8709a0423cacfcaf645fe4803
MD5 254d844a1b982afc1d7bb638a674ed13
BLAKE2b-256 557c2a006643eb6946667311e566fec78d0f24a9c8cb940c4603218344114b9c

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