Client Reference

This module contains the client classes used to interact with the PyPI APIs.

class pypiwrap.client.PyPIClient(host='https://pypi.org')

Client for the PyPI JSON and Stats API.

Warning

This client is only designed for hosts under the pypi.org domain.

Parameters:

host (str, optional) – The base URL of the PyPI API host. Defaults to https://pypi.org.

get_project(name: str, version: str | None = None) Project

Gets information about a project or any of its releases.

Parameters:
  • name (str) – The name of the project

  • version (str) – A version of the project to fetch. If none specified, the latest will be fetched.

get_stats() Stats

Gets statistics about PyPI.

class pypiwrap.client.PyPIFeedClient(host='https://pypi.org')

Client for the PyPI RSS feeds.

Added in version 2.0.0.

Warning

This client is only designed for hosts under the pypi.org domain.

Parameters:

host (str, optional) – The base URL of the PyPI feeds host. Defaults to https://pypi.org.

get_latest_releases_for_project(name: str) PyPIFeed

Gets the latest releases for a project name.

get_latest_updates() PyPIFeed

Gets the latest updates for individual projects on PyPI.

get_newest_packages() PyPIFeed

Gets the newest packages created on PyPI.

class pypiwrap.client.SimpleRepoClient(host: str = 'https://pypi.org')

Client for the PyPI Simple Repository API (version 1).

The methods included will emit a UnexpectedVersionWarning warning if it receives a response with a minor version greater than what’s supported.

As per PEP 629, the client will throw a UnsupportedVersionError exception if it receives a response with a major version greater than what’s supported.

Parameters:

host (str, optional) – The base URL of the Simple Repository API host. Defaults to https://pypi.org.

get_index_page() IndexPage

Gets the index page for this repository.

Warning

If you’re using the PyPI host, the response returned by PyPI could take several seconds to parse. Please use this method sparingly.

get_project_page(project: str) ProjectPage

Gets the project page for a given project.