pypi-simple — PyPI Simple Repository API client library

GitHub | PyPI | Documentation | Issues | Changelog

pypi-simple is a client library for the Python Simple Repository API as specified in PEP 503 and updated by PEP 592, PEP 629, PEP 658, PEP 691, PEP 700, PEP 708, and PEP 714. With it, you can query the Python Package Index (PyPI) and other pip-compatible repositories for a list of their available projects and lists of each project’s available package files. The library also allows you to download package files and query them for their project version, package type, file digests, requires_python string, PGP signature URL, and metadata URL.


pypi-simple requires Python 3.7 or higher. Just use pip for Python 3 (You have pip, right?) to install it:

python3 -m pip install pypi-simple

pypi-simple can optionally make use of tqdm. To install it alongside pypi-simple, specify the tqdm extra:

python3 -m pip install "pypi-simple[tqdm]"


Get information about a package:

>>> from pypi_simple import PyPISimple
>>> with PyPISimple() as client:
...     requests_page = client.get_project_page('requests')
>>> pkg = requests_page.packages[0]
>>> pkg.filename
>>> pkg.url
>>> pkg.project
>>> pkg.version
>>> pkg.package_type
>>> pkg.digests
{'sha256': '813202ace4d9301a3c00740c700e012fb9f3f8c73ddcfe02ab558a8df6f175fd'}

Download a package with a tqdm progress bar:

from pypi_simple import PyPISimple, tqdm_progress_factory

with PyPISimple() as client:
    page = client.get_project_page("pypi-simple")
    pkg = page.packages[-1]
        pkg, path=pkg.filename, progress=tqdm_progress_factory(),

Indices and tables