PyPI JSON API client

0.5.0.post1 · active · verified Fri Apr 17

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.

Common errors

Warnings

Install

Imports

Quickstart

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.

from pypi_json import PyPIJSON

pypi = PyPIJSON()

try:
    # Example: Get metadata for the 'requests' package
    package = pypi.get_package("requests")
    print(f"Package Name: {package.name}")
    print(f"Latest Version: {package.version}")
    print(f"Summary: {package.summary}")

    # Accessing specific release information
    if package.releases:
        latest_release_info = package.releases[package.version]
        print(f"Upload Time of latest version: {latest_release_info.upload_time_iso_8601}")

except Exception as e:
    print(f"An error occurred: {e}")

view raw JSON →