letsbuilda.pypi.async_client

The async client.

Classes

PyPIServices

A class for interacting with PyPI.

Module Contents

class letsbuilda.pypi.async_client.PyPIServices(http_client: httpx.AsyncClient)[source]

A class for interacting with PyPI.

NEWEST_PACKAGES_FEED_URL: Final[str] = 'https://pypi.org/rss/packages.xml'[source]
PACKAGE_UPDATES_FEED_URL: Final[str] = 'https://pypi.org/rss/updates.xml'[source]
http_client[source]
async get_rss_feed(feed_url: str) list[letsbuilda.pypi.models.RSSPackageMetadata][source]

Get the new packages RSS feed.

Parameters:

feed_url – The URL of the RSS feed.

Returns:

The list of new packages.

Return type:

list[RSSPackageMetadata]

async get_package_json_metadata(package_title: str, package_version: str | None = None) letsbuilda.pypi.models.JSONPackageMetadata[source]

Retrieve metadata for a package.

Raises:

PackageNotFoundError – If the package is not found.

Parameters:
  • package_title – The title of the package.

  • package_version – The version of the package.

Returns:

The metadata for the package.

Return type:

JSONPackageMetadata

async get_package_metadata(package_title: str, package_version: str | None = None) letsbuilda.pypi.models.Package[source]

Create a Package object from its metadata.

Parameters:
  • package_title – The title of the package.

  • package_version – The version of the package.

Returns:

The package object.

Return type:

Package