letsbuilda.pypi¶
A wrapper for PyPI’s API and RSS feed.
Submodules¶
Exceptions¶
Raised when a package is not found. |
Classes¶
Package metadata. |
|
Metadata for a package. |
|
RSS Package metadata. |
|
A class for interacting with PyPI. |
Package Contents¶
- exception letsbuilda.pypi.PackageNotFoundError(package_title: str, package_version: str | None)[source]¶
Bases:
Exception
Raised when a package is not found.
- class letsbuilda.pypi.JSONPackageMetadata(/, **data: Any)[source]¶
Bases:
pydantic.BaseModel
Package metadata.
- vulnerabilities: list[Vulnerability][source]¶
- class letsbuilda.pypi.Package(/, **data: Any)[source]¶
Bases:
pydantic.BaseModel
Metadata for a package.
- class letsbuilda.pypi.RSSPackageMetadata(/, **data: Any)[source]¶
Bases:
pydantic.BaseModel
RSS Package metadata.
- class letsbuilda.pypi.PyPIServices(http_client: httpx.Client)[source]¶
A class for interacting with PyPI.
- 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:
- 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:
- 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: