Skip to main content

A package for scraping data from basketball-reference.com and stats.nba.com to provide opponent-adjusted statistics.

Project description

Defense Adjusted NBA Stats

This is a package that collects data from basketball-reference.com and stats.nba.com and provides endpoints that adjust a player's statistics depending on their opponents defensive strength.

Why adjust stats?

Numbers at face-value don't always tell the full story. For example, if player A scores 30 points on 50% from the field, and player B scores 27 points on 47% from the field, we could come to the conclusion that player A had a better scoring game.

However, what if player B faced one of the best defensive teams in the league, and player A faced a mediocre defensive team? How does that change how we view those performances?

This package attempts to provide a more even playing field with statistics by using the opponent team's defensive to adjust a player scoring and efficiency. For more details about how stats are "adjusted", see the methodology here.

Stats from basketball-reference for this package go back to the 1970-71 season, and stats from nba-stats only go back to the 1996-97 season.

You can find the full details for this API here.

Installing

Via pip

Install using the following command:

pip install dans

Via GitHub

Or, you can clone this repo to a Git repository on your local machine.

License & Terms of Use

API Package

The dans package is Open Source with an MIT License.

NBA.com

NBA.com has a Terms of Use regarding the use of the NBA’s digital platforms.

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

dans-1.0.2.tar.gz (106.3 kB view details)

Uploaded Source

Built Distribution

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

dans-1.0.2-py3-none-any.whl (104.7 kB view details)

Uploaded Python 3

File details

Details for the file dans-1.0.2.tar.gz.

File metadata

  • Download URL: dans-1.0.2.tar.gz
  • Upload date:
  • Size: 106.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for dans-1.0.2.tar.gz
Algorithm Hash digest
SHA256 e135536a1ef02e41b011f93052085869c23d4a6cb84528ee65cf30b871ab64e9
MD5 a1b339085f725daff6b8a87df202a2e5
BLAKE2b-256 316f0583af8a89fad2ba089c4b4d832ddeec5c3129153b9ce73e7a92685b79f4

See more details on using hashes here.

File details

Details for the file dans-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: dans-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 104.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.0

File hashes

Hashes for dans-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 81a860f5f1e9420cfe2982bb504aebe69c5bf938bfcfd95d3bab731467a557f9
MD5 31a4271319fe8a1bd41f2428da721e0f
BLAKE2b-256 f9de97f2e0d4f8491cd720d80b4139705b7c6c51b723083a5120823717ef8ca6

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