PyPI Simple Repository API client library
Project description
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, and PEP 691. 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 pypi-simple and its dependencies:
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://pypi-hypernode.com/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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pypi_simple-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | caa88cc2921deb60bc7da52c72f6cced0a3ed07cced989b255d6e26e4a379970 |
|
MD5 | a50e6f6ab9553a26d2d1734df7de85e8 |
|
BLAKE2b-256 | 31e7baa8a18f9ded5b85cbf245f60ae59ed4e6575f0a3e50e17db6afbda94baf |