PyPI Client

raw JSON →
2.1 verified Fri May 01 auth: no python deprecated

Provides access to the Python Package Index (PyPI) metadata. Version 2.1 is outdated and unmaintained; use `pip` or `requests` directly instead.

pip install pypi
error ImportError: cannot import name 'PyPI' from 'pypi'
cause Incorrect import path. The 'pypi' package has submodules.
fix
Use 'from pypi import PyPI'
error ModuleNotFoundError: No module named 'pypi'
cause Package not installed or named incorrectly.
fix
Run 'pip install pypi'
error AttributeError: module 'pypi' has no attribute 'get_packages'
cause The function may be named differently or removed.
fix
Check documentation; use 'PyPI().get_packages()' or switch to JSON API.
deprecated The 'pypi' package is outdated and unmaintained. Use 'pip' or direct HTTP requests to https://pypi.org/pypi/<package>/json.
fix Replace with 'pip show <package>' or 'requests.get(f'https://pypi.org/pypi/{package}/json').json()'
gotcha The package may not support PEP 503 (Simple Repository API) and relies on old XML-RPC API (deprecated).
fix Switch to using the JSON API directly.

Initialize PyPI client and fetch packages.

from pypi import PyPI
client = PyPI()
# List all packages (takes time)
# packages = client.get_packages()
# For single package info, use pip or requests instead.