Skip to main content

Python module for Basketball Reference scraping and easy access to basketball data, including NBA, G League and international leagues

Project description

pypi python version license

BRScraper

Python package for easy access to basketball data through scraping of Basketball Reference website.

This allows users to obtain statistics, standings, and scores for various seasons and phases of the following tournaments:

  • NBA
  • G League
  • International Tournaments (Olympics, EuroLeague, EuroCup and international leagues from: Spain, Australia, China, France, Greece, Israel, Italy, Turkey, Russia and ABA)

Installing

Via pip

This library was written as an exercise for creating my first PyPi package. Hopefully you will find it valuable! Install with the following command:

pip install BRScraper

Documentation

For documentation about the API methods refer to the documentation.

Example of use

from BRScraper import nba
# All players stats per game regular season
nba.get_stats(2023, info='per_game', playoffs=False, rename=False).head()

Output:

Player Pos Age Tm G GS ... STL BLK TOV PF PTS Season
0 Precious Achiuwa C 23 TOR 55 12 ... 0.6 0.5 1.1 1.9 9.2 2022-23
1 Steven Adams C 29 MEM 42 42 ... 0.9 1.1 1.9 2.3 8.6 2022-23
2 Bam Adebayo C 25 MIA 75 75 ... 1.2 0.8 2.5 2.8 20.4 2022-23
3 Ochai Agbaji SG 22 UTA 59 22 ... 0.3 0.3 0.7 1.7 7.9 2022-23
4 Santi Aldama SF 22 MEM 77 20 ... 0.6 0.6 0.8 1.9 9.0 2022-23

More examples in the files.

Use it wisely!

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

brscraper-1.0.3.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

BRScraper-1.0.3-py3-none-any.whl (19.5 kB view details)

Uploaded Python 3

File details

Details for the file brscraper-1.0.3.tar.gz.

File metadata

  • Download URL: brscraper-1.0.3.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for brscraper-1.0.3.tar.gz
Algorithm Hash digest
SHA256 2ad0de77ebe4faf4ef9c8e3ae356cb2667b5fa5c4de074859844c2262e7efbb2
MD5 2fb1ec9c5e2b07b627a4903ba75c8eb4
BLAKE2b-256 1d4ad2119fc63fe23fca56a7b4c45a5ad63fa0f74d6a51c4de3460ad2cc5f8f3

See more details on using hashes here.

File details

Details for the file BRScraper-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: BRScraper-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 19.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.12.1

File hashes

Hashes for BRScraper-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c75a5fb189446f92c323f6082f917d49d152378ec2b8d174f857afc88576619f
MD5 ecf1f782e68eef9c7b67d059ab001431
BLAKE2b-256 eaacf3c8add08a3a55b7fc9f909b96be7b6273ae980f23bbbd27ebeb08c13d7b

See more details on using hashes here.

Supported by

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