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.
Metadata
Release files for dans 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dans-1.1.3.tar.gz | 2.4 MB | With provenance | Details for dans-1.1.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dans-1.1.3-py3-none-any.whl | Python 3 | none | any | Details for dans-1.1.3-py3-none-any.whl |
Total release size: 4.8 MB
Release files / dans-1.1.3.tar.gz
| Download URL | dans-1.1.3.tar.gz |
|---|---|
| Size | 2.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5c34bd303694939062be55c8b3276c8aab3689ca62a861e56377b886284e4eb3
|
|
BLAKE2b-256 checksum How to use checksums |
05501895cf6be2c8e1e24269655bdd59a44bf201b8ca2dcb80b50ca79cc6569e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 12, 2026.
Transparency logRelease files / dans-1.1.3-py3-none-any.whl
| Download URL | dans-1.1.3-py3-none-any.whl |
|---|---|
| Size | 2.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9002964656754f3c885be7876d9f764357004a0eec820ebe078f985a10d81066
|
|
BLAKE2b-256 checksum How to use checksums |
1e0f550ba7ab2ff56c3351c7a7453457f64cdd7b6fae7f2ac3c045c6ca0fd21d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 12, 2026.
Transparency logSecurity for dans 1.1.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for dans-1.1.3.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 12, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.