Product SiteDocumentation Site

The Python API Hierarchy

The RPM Python API provides a high-level abstraction into RPM functionality divided into logical areas. Table 17-1 lists the main RPM types. In most cases, you need to begin with rpm and create a transaction set.
Table 17-1 Python types for RPM usage
Class
Covers
rpm
RPM base module into RPM API
rpmts
Transaction sets
rpmte
Transaction elements, a package in a transaction set
rpmmi
Match iterators, used for querying the RPM database
Rpmds
Dependency set
Rpmfi
File into set
Header
A package header
In general, the RPM Python API is well-integrated into the standard Python API. For example, you use the Python os class to read in RPM package files.
Note
The examples in this chapter use the RPM 4.1 Python API. The API in previous versions is significantly different from the 4.1 version.