letsbuilda.pypi.sync_client

The sync client.

Exceptions

PackageNotFoundError

Raised when a package is not found.

Classes

JSONPackageMetadata

Package metadata.

Package

Metadata for a package.

RSSPackageMetadata

RSS Package metadata.

PyPIServices

A class for interacting with PyPI.

Module Contents

exception letsbuilda.pypi.sync_client.PackageNotFoundError(package_title: str, package_version: str | None)[source]

Bases: Exception

Raised when a package is not found.

class letsbuilda.pypi.sync_client.JSONPackageMetadata[source]

Package metadata.

info: Info[source]
last_serial: int[source]
urls: list[URL][source]
vulnerabilities: list[Vulnerability][source]
classmethod from_dict(data: dict) Self[source]

Build an instance from a dictionary.

class letsbuilda.pypi.sync_client.Package[source]

Metadata for a package.

title: str[source]
releases: list[Release][source]
classmethod from_json_api_data(data: letsbuilda.pypi.models.models_json.JSONPackageMetadata) Self[source]

Build an instance from the JSON API data.

class letsbuilda.pypi.sync_client.RSSPackageMetadata[source]

RSS Package metadata.

title: str[source]
version: str | None[source]
guid: str | None[source]
description: str | None[source]
author: str | None[source]
publication_date: datetime.datetime[source]
classmethod build_from(data: dict[str, str]) Self[source]

Build an instance from raw data.

class letsbuilda.pypi.sync_client.PyPIServices(http_client: httpx.Client)[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]
get_rss_feed(feed_url: str) list[letsbuilda.pypi.models.RSSPackageMetadata][source]

Get the new packages RSS feed.

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

Get metadata for a package.

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

Get metadata for a package.