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.

Read the full documentation 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.1.2.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

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

dans-1.1.2-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: dans-1.1.2.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dans-1.1.2.tar.gz
Algorithm Hash digest
SHA256 2c32bce212305ab029f62b093e289ba3348a4a71ae38e4a7b58dd5d0beb69033
MD5 407ca33f014ff65e889d53ee461b77f3
BLAKE2b-256 0c05eb8b214a814ae8d5b1a6ea55086508fb4ca768e478a9032985b9e4f3eb09

See more details on using hashes here.

Provenance

The following attestation bundles were made for dans-1.1.2.tar.gz:

Publisher: release.yml on oscarg617/dans

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: dans-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for dans-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 13fccb5f165d7f59d0c88fe25a2dd15d0864ebeac686bb4fa8845ba6ff975e10
MD5 192020c988325a389b84370b066fa0d7
BLAKE2b-256 0f7b19c2dd7e4d1be0dcccb7f8e5244fe9a3fc8f090b0867e0a048a971e07b47

See more details on using hashes here.

Provenance

The following attestation bundles were made for dans-1.1.2-py3-none-any.whl:

Publisher: release.yml on oscarg617/dans

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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