pypi-bulk-download
Download PyPI packages in bulk, filtered by real-world popularity, in
parallel, with safe archive unpacking and a JSON manifest. Built for
assembling research corpora (security scanning, ecosystem analysis, mirrors)
without hand-rolling pip download loops.
Downloads go through pip download, so wheels, sdists, platform tags, and
custom indexes behave exactly as pip does. Popularity comes from the public
top-pypi-packages 30-day dataset.
Install
pip install pypi-bulk-download
CLI
# Top 50 packages with >= 100k downloads/month, source dists, no deps
pypi-bulk-download --min-downloads 100000 --limit 50 --format sdist --no-deps -o corpus/
# Specific packages, 4 workers, write a manifest
pypi-bulk-download --packages requests flask httpx --workers 4 --save-manifest corpus/manifest.json
# From a requirements file, then safely unpack every archive
pypi-bulk-download -r requirements.txt -o corpus/ --unpack
# See the plan without downloading
pypi-bulk-download --min-downloads 50000 --limit 20 --dry-run
Library
from pypi_bulk_download import fetch_top_packages, download_many, save_manifest
targets = fetch_top_packages(min_downloads=100_000, limit=25)
results = download_many(targets, "corpus/", workers=4, prefer_format="sdist", no_deps=True)
save_manifest(results, "corpus/manifest.json")
print(sum(r.success for r in results), "of", len(results), "downloaded")
Safe unpacking
unpack_archive / unpack_all validate every tar/zip member against path
traversal (tar-slip / zip-slip) before extracting — untrusted archives can't
write outside their destination folder.
from pypi_bulk_download import unpack_all
unpacked, failed = unpack_all("corpus/", remove_archives=False)
Notes
- Depends only on
requests(pluspip, which you already have). --format sdistfalls back to the best wheel when no source distribution exists, rather than failing hard.- This tool downloads third-party code. Do not commit the download
directory to your own repository; the included
.gitignoreexcludespkgs/,downloads/, and archive files by default.
License
MIT (this tool). Downloaded packages retain their own licenses.
Metadata
Release files for pypi-bulk-download 0.1.0
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 |
|---|---|---|---|---|
| pypi_bulk_download-0.1.0.tar.gz | 8.9 kB | Without provenance | Details for pypi_bulk_download-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pypi_bulk_download-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for pypi_bulk_download-0.1.0-py3-none-any.whl |
Total release size: 19.6 kB
Release files / pypi_bulk_download-0.1.0.tar.gz
| Download URL | pypi_bulk_download-0.1.0.tar.gz |
|---|---|
| Size | 8.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7db2c444b9e957bcaebafe9a9ec2bfec8d7c42fa140abc3a529fcd9fa0a456eb
|
|
BLAKE2b-256 checksum How to use checksums |
fc93f6f62bed98c3d41963a7cf7567463a587f20938ffa5a4a7ba832ee506a7a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Release files / pypi_bulk_download-0.1.0-py3-none-any.whl
| Download URL | pypi_bulk_download-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5cd29fdb243ec8520d09f30319b91c1050df363a891e28a17bcabc9ea19c2751
|
|
BLAKE2b-256 checksum How to use checksums |
9b86a2b110b436372d4e7532ba03ff11c132bc1c86ffe8ee41d89c738c646206
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.10.11
|
Security for pypi-bulk-download 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A 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.