Registry / http-networking / pypi-simple

pypi-simple

JSON →
library1.8.0pypypi✓ verified 87d ago

pypi-simple is a client library for the Python Simple Repository API, as specified in PEP 503 and updated by various other PEPs (592, 629, 658, 691, 700, 708, 714, 740, 792). It allows users to query PyPI and other pip-compatible repositories for available projects and their package files, download packages, and inspect their metadata. The current version is 1.8.0. While no explicit release cadence is stated, the project maintains regular updates, with version 1.8.0 released on September 3, 2025.

pip install pypi-simple
INSTALL
IMPORT
SIG · PYPI-SIMPLE
P
pypi-simple
http-networkingpythonv1.8.0
Install
4.3s avg
Import
1599ms
Disk
33MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.8.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 1.688s · 34.4MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 4.3s · import 1.509s · 34MB
33MB installed
● package 33MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

PyPISimple
from pypi_simple import PyPISimple
tqdm_progress_factory
from pypi_simple import PyPISimple, tqdm_progress_factory
Required when installing with the 'tqdm' extra for progress bar integration.

This quickstart demonstrates how to fetch details for a specific project like 'requests' using `PyPISimple.get_project_page()`. It also includes a commented-out example for streaming all project names using `stream_project_names()`, with a caution about the size of PyPI's index.

from pypi_simple import PyPISimple # Example 1: Get information about a package with PyPISimple() as client: requests_page = client.get_project_page('requests') if requests_page and requests_page.packages: pkg = requests_page.packages[0] print(f"Latest 'requests' package: {pkg.filename} (version {pkg.version})") print(f"Download URL: {pkg.url}") # Example 2: List all project names (caution: this can be slow and large) # try: # with PyPISimple() as client: # # PyPI's top-level simple HTML page is cached for 24 hours. # # Use stream_project_names() for potentially faster, memory-efficient retrieval. # all_projects = list(client.stream_project_names()) # print(f"Found {len(all_projects)} projects.") # except Exception as e: # print(f"Error listing projects: {e}")
Debug
Known issues
deprecatedThe `DistributionPackage.provenance_sha256` attribute is deprecated and will always be `None`.
fix
Avoid relying on `provenance_sha256`. Use `provenance_url` if provenance information is needed.
affects: >=1.6.0
deprecatedThe `verify` argument in `PyPISimple.get_provenance()` is deprecated, and the method no longer verifies the provenance's digest.
fix
If provenance digest verification is critical, implement it separately after fetching the provenance data.
affects: >=1.6.0
breakingSupport for Python 3.7 was dropped in version 1.6.0.
fix
Ensure your environment uses Python 3.8 or higher.
affects: >=1.6.0
gotchaCalling `PyPISimple.get_index_page()` (which returns a list of all projects) can be very slow due to the size of PyPI's index. PyPI's top-level simple HTML page is also cached for 24 hours.
fix
For specific project information, use `client.get_project_page('projectname')`. If you need to iterate through all projects, use `client.stream_project_names()` for better performance and memory management.
affects: All
Errors
Common errors & fixes
ImportError: cannot import name 'PyPISimple' from 'pypi_simple'
Typo in the import statement or trying to import from an incorrect module.
fix
Ensure the import path is exactly `from pypi_simple import PyPISimple`.
AttributeError: 'NoneType' object has no attribute 'packages'
The `get_project_page()` method returned `None`, indicating that the project name was not found or there was an issue fetching the page.
fix
Always check if the result of `get_project_page()` is `None` before attempting to access its attributes (e.g., `if project_page and project_page.packages:`).
PyPISimple.exceptions.DigestMismatchError: Digest mismatch for ...
The downloaded package file's digest (e.g., SHA256) does not match the one advertised by the repository, indicating possible corruption or tampering.
fix
This often points to a problem with the repository or download. You can try downloading again. If it persists, report it to the package maintainers or the repository. The exception object itself might contain `url` fields for more details.
Upgrade
Version history
1.8.0latest on PyPI · released Sep 3, 2025
Audit
Dependencies
tqdmoptionalProvides progress bar functionality for downloads.
Agent activity
2 hits · last 30 days
node
2
Resources
pypi-simple — pip install pypi-simple · libregistry