A Python client for scraping stats and data from Basketball Reference
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.
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
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).
Currently, the package contains 5 modules:
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.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size basketball_reference_scraper-1.0.4-py3-none-any.whl (16.0 kB)||File type Wheel||Python version py3||Upload date||Hashes View hashes|
|Filename, size basketball_reference_scraper-1.0.4.tar.gz (8.6 kB)||File type Source||Python version None||Upload date||Hashes View hashes|
Hashes for basketball_reference_scraper-1.0.4-py3-none-any.whl
Hashes for basketball_reference_scraper-1.0.4.tar.gz