pypi-json is a Python client library for accessing the PyPI JSON API. It allows programmatic retrieval of package metadata, including versions, summaries, dependencies, and more. The current version is 0.5.0.post1, and it has an infrequent but active release cadence, with the latest update in February 2026.
pip install pypi-jsonVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to instantiate the PyPIJSON client and retrieve metadata for a specific package, such as 'requests'. It shows how to access basic package attributes and specific release information, including error handling for network or package not found issues.
Wrap calls to `pypi.get_package()` in a `try...except httpx.HTTPStatusError` block to gracefully handle non-existent packages.
Refer to the official PyPI JSON API documentation or inspect the object's available attributes (e.g., `dir(package)`) to ensure correct field access. Be prepared for schema changes in future PyPI API versions.
Verify the package name for correctness. Implement `try...except httpx.HTTPStatusError` to handle non-existent packages gracefully.
Check the available attributes of the `Package` object (e.g., by printing `dir(package)`) or consult the PyPI JSON API documentation to find the correct attribute name.
Check your internet connection and DNS settings. Ensure no firewall is blocking access to `pypi.org`. If the issue persists, PyPI might be experiencing downtime, so try again later.