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

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.31.tar.gz (44.9 kB view details)

Uploaded Source

Built Distribution

File details

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

File metadata

  • Download URL: basketball_reference_scraper-1.0.31.tar.gz
  • Upload date:
  • Size: 44.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.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.31.tar.gz
Algorithm Hash digest
SHA256 2344f4573a2262f564b532eac96a6ee6834da713e1de394bb849780e50e185b3
MD5 81ed2ace38b24cd84aafe38774a72736
BLAKE2b-256 b7d9d305b624569f7fdda759a20bd3387a7f837f3fc7eb6b381db33fb412529b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: basketball_reference_scraper-1.0.31-py3-none-any.whl
  • Upload date:
  • Size: 50.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.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.31-py3-none-any.whl
Algorithm Hash digest
SHA256 0eaf762c10a893eac5eeb9ac939ea5ece9148540501ff6d5ed72473256b4903c
MD5 919ec39b928f6877ca39f53d6a8ca8b7
BLAKE2b-256 c329866e66ac60e58dd0323deec049d93d7319afce0ae9ce3e292d37c1db160a

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