Estimate the downstream impact ('blast radius') of a PyPI package version from deps.dev dependent counts and download volume.
Project description
pypi-blast-radius
Estimate the downstream impact of a specific PyPI package version — how many other projects would be affected if it had a vulnerability. It combines deps.dev direct/indirect dependent counts with an optional monthly-download figure into a single, conservative impact proxy you can use to rank findings.
The proxy is ranking evidence, not a precise affected-install count. PyPI does not expose reliable reverse-dependent download totals, so any such number is an estimate.
Install
pip install pypi-blast-radius
Library usage
from pypi_blast_radius import estimate_blast_radius
result = estimate_blast_radius("requests", "2.31.0", direct_downloads=1_000_000)
print(result["direct_dependent_count"]) # from deps.dev
print(result["indirect_dependent_count"]) # from deps.dev
print(result["estimated_transitive_downloads"]) # bounded proxy
print(result["total_impact_score"]) # downloads + proxy
If deps.dev has no data for the version, or inputs are missing, an empty dict is returned (never an exception).
CLI
pypi-blast-radius requests 2.31.0 --downloads 1000000
pypi-blast-radius requests 2.31.0 --json
How the proxy works
direct_dependent_countandindirect_dependent_countcome straight from deps.dev.estimated_transitive_downloads = direct_downloads * min(10, log1p(direct + 0.2*indirect) * 0.9)— indirect dependents are weighted lower, and the multiplier is capped at 10x so a huge dependent graph can't produce an absurd number.- Results are cached in-process; call
clear_cache()to reset.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pypi_blast_radius-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pypi_blast_radius-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
375df3a9bee88e211f2a3676b8715e8564d2c0eec8f66b14fa84267654e65eff
|
|
| MD5 |
6f8efe038ab119e8f0bcb77b1212b197
|
|
| BLAKE2b-256 |
be2f000a662cf3a257ca25942aaaff23434c16f8fbc09c1907d88b4a5f3fb6d2
|