mainframe.pypi¶
Minimal client over PyPI JSON API.
Attributes¶
Exceptions¶
Raised when a package version is not found on PyPI. |
Classes¶
A single downloadable file (e.g. an sdist or wheel) for a release. |
|
The subset of PyPI package metadata that mainframe uses. |
|
The info object of the PyPI JSON response (only the fields we read). |
|
The shape of the PyPI JSON response, limited to what we parse. |
|
A minimal synchronous client for the PyPI JSON API. |
Module Contents¶
- exception mainframe.pypi.PackageNotFoundError(name: str, version: str)[source]¶
Bases:
ExceptionRaised when a package version is not found on PyPI.
- class mainframe.pypi.Distribution(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelA single downloadable file (e.g. an sdist or wheel) for a release.
- class mainframe.pypi.PackageMetadata(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelThe subset of PyPI package metadata that mainframe uses.
- distributions: list[Distribution][source]¶
- class mainframe.pypi.Info(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelThe info object of the PyPI JSON response (only the fields we read).
- class mainframe.pypi.JSONResponse(/, **data: Any)[source]¶
Bases:
pydantic.BaseModelThe shape of the PyPI JSON response, limited to what we parse.
- urls: list[Distribution] = None[source]¶
- class mainframe.pypi.PyPIClient(http_client: httpx.Client)[source]¶
A minimal synchronous client for the PyPI JSON API.
- get_package_metadata(name: str, version: str) PackageMetadata[source]¶
Fetch metadata for a specific version of a package.
- Parameters:
name – The package name.
version – The package version.
- Returns:
The metadata for the requested package.
- Raises:
PackageNotFoundError – If the package or version does not exist on PyPI.