pypi-json

PyPI JSON API client library

Docs

Documentation Build Status Docs Check Status

Tests

Linux Test Status Windows Test Status macOS Test Status Coverage

PyPI

PyPI - Package Version PyPI - Supported Python Versions PyPI - Supported Implementations PyPI - Wheel

Anaconda

Conda - Package Version Conda - Platform

Activity

GitHub last commit GitHub commits since tagged version Maintenance PyPI - Downloads

QA

CodeFactor Grade Flake8 Status mypy status

Other

License GitHub top language Requirements Status

pypi-json is a client library for the Python JSON API. With it, you can query the Python Package Index (PyPI), and other repositories using the same API, for project metadata, including available releases and downloadable package files.

Installation

python3 -m pip install pypi-json --user

Example

>>> from pypi_json import PyPIJSON
>>> from pprint import pprint
>>> with PyPIJSON() as client:
...     requests_metadata = client.get_metadata("requests")
>>> pkg = requests_metadata.urls[0]
>>> pprint(pkg)
{'comment_text': '',
 'digests': {'md5': 'deb79adc50b8205783221cfff7075d1e',
             'sha256': '6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24'},
 'downloads': -1,
 'filename': 'requests-2.26.0-py2.py3-none-any.whl',
 'has_sig': False,
 'md5_digest': 'deb79adc50b8205783221cfff7075d1e',
 'packagetype': 'bdist_wheel',
 'python_version': 'py2.py3',
 'requires_python': '>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, '
                    '!=3.5.*',
 'size': 62251,
 'upload_time': '2021-07-13T14:55:06',
 'upload_time_iso_8601': '2021-07-13T14:55:06.933494Z',
 'url': 'https://files.pythonhosted.org/packages/92/96/144f70b972a9c0eabbd4391ef93ccd49d0f2747f4f6a2a2738e99e5adc65/requests-2.26.0-py2.py3-none-any.whl',
 'yanked': False,
 'yanked_reason': None}
>>> list(requests_metadata.releases.keys())[:10]
['0.0.1', '0.10.0', '0.10.1', '0.10.2', '0.10.3', '0.10.4', '0.10.6', '0.10.7', '0.10.8', '0.11.1']