Skip to main content

PyPI Simple Repository API client library

Project description

Project Status: Active — The project has reached a stable, usable state and is being actively developed. CI Status https://codecov.io/gh/jwodder/pypi-simple/branch/master/graph/badge.svg https://img.shields.io/pypi/pyversions/pypi-simple.svg MIT License

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.

See the documentation for more information.

Installation

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]"

Example

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
'requests-0.2.0.tar.gz'
>>> pkg.url
'https://files.pythonhosted.org/packages/ba/bb/dfa0141a32d773c47e4dede1a617c59a23b74dd302e449cf85413fc96bc4/requests-0.2.0.tar.gz'
>>> pkg.project
'requests'
>>> pkg.version
'0.2.0'
>>> pkg.package_type
'sdist'
>>> 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]
    client.download_package(
        pkg, path=pkg.filename, progress=tqdm_progress_factory(),
    )

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pypi-simple-1.4.0.tar.gz (57.2 kB view details)

Uploaded Source

Built Distribution

pypi_simple-1.4.0-py3-none-any.whl (24.8 kB view details)

Uploaded Python 3

File details

Details for the file pypi-simple-1.4.0.tar.gz.

File metadata

  • Download URL: pypi-simple-1.4.0.tar.gz
  • Upload date:
  • Size: 57.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pypi-simple-1.4.0.tar.gz
Algorithm Hash digest
SHA256 f0a2bce892bf6a878fb0975e245310187e888a2bfb374ecdb6377aa3c3540cd6
MD5 a5a6733ca28e3e76e32a5d8576a4a674
BLAKE2b-256 7f6bfa677e509b37d0947b5a372d676fd15568312f00e8f86d4cc9eb2c5d966a

See more details on using hashes here.

File details

Details for the file pypi_simple-1.4.0-py3-none-any.whl.

File metadata

  • Download URL: pypi_simple-1.4.0-py3-none-any.whl
  • Upload date:
  • Size: 24.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for pypi_simple-1.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d92fe0c0eab03f9515bceacbdb32ca194b31632d992bf26a2634a3bc6d29d5f
MD5 6191e0e98840ae3124cfabb5c36bef24
BLAKE2b-256 113d0d4d7efd7282effbf0386370129e36a38e1785155ef34c1c7009294c83bf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page