Python APT Library¶
Python APT’s library provides access to almost every functionality supported by the underlying apt-pkg and apt-inst libraries. This means that it is possible to rewrite frontend programs like apt-cdrom in Python, and this is relatively easy, as can be seen in e.g. Writing your own apt-cdrom.
When going through the library, the first two modules are apt_pkg
and
apt_inst
. These modules are more or less straight bindings to the
apt-pkg and apt-inst libraries and the base for the rest of python-apt.
Going forward, the apt
package appears. This package is using
apt_pkg
and apt_inst
to provide easy to use ways to manipulate
the cache, fetch packages, or install new packages. It also provides useful
progress classes, currently only for text interfaces. The last package is
aptsources
. The aptsources package provides classes and functions to
read files like /etc/apt/sources.list
and to modify them.
apt_pkg
— The low-level bindings for apt-pkgapt_inst
- Working with local Debian packagesapt.cache
— The Cache classapt.cdrom
- Functionality like in apt-cdromapt.debfile
— Classes related to debian package filesapt.package
— Classes for package handlingapt.progress.base
— Abstract classes for progress reportingapt.progress.text
— Progress reporting for text interfacesaptsources.distinfo
— provide meta information for distro repositoriesaptsources.distro
— Distribution abstraction of the sources.listaptsources.sourceslist
— Provide an abstraction of the sources.list