rpm.hdr

Headers

This represents an RPM header object. The header contains metadata about a package. A header can be returned from the RPM database or from an RPM package on disk. Below we extract a header object from an RPM file.

import rpm, os
# rpm.ts is an alias for rpm.TransactionSet
ts = rpm.ts()
fdno = os.open("/tmp/foo-1.0-1.i386.rpm", os.O_RDONLY)
hdr = ts.hdrFromFdno(fdno)
os.close(fdno)