API Reference

The following section outlines the API of apip.

Client

Methods
class apip.Client(index='https://pypi.org/simple')

The main class for the apip API wrapper. This class is used to interact with the Pip and PyPi API.

Parameters:

index (str) – The index to install the package from.

await list()

Lists all installed packages and returns them in a list of Package objects.

Returns:

A list of Package objects for all installed packages.

Return type:

list

Package

Methods
class apip.Package(name, version, author=None, summary=None, description=None, license=None, author_email=None, classifiers=None, homepage=None, keywords=None, index='https://pypi.org/simple')
await install()

Installs itself through the Pip API. Returns itself.

Returns:

A Package object for the installed package.

Raises:
await uninstall()

Uninstalls itself through the Pip API.

Raises:

PackageNotFoundException – The package was not found.

Exceptions

The following exceptions are thrown by the library.

exception apip.errors.PipException

Bases: Exception

A base class for apip exceptions.

exception apip.errors.ConnectionException

Bases: PipException

An exception raised when the API could not access the server.

exception apip.errors.PackageException

Bases: PipException

A base exception for package errors.

exception apip.errors.PackageNotFoundException

Bases: PackageException

An exception that is raised when the API could not find the package.

exception apip.errors.VersionNotFoundException

Bases: PackageException

An exception raised when the version is not available for the specified package.

Exception Hierarchy