Read rpm archive files
Project description
rpmfile
Tools for inspecting RPM files in python. This module is modeled after the tarfile module.
Install
$ python -m pip install -U rpmfile
If you want to use rpmfile
with zstd
compressed rpms, you'll need to install
the zstandard module.
zstd
also requires that you are using Python >= 3.5
$ python -m pip install -U zstandard
Example
import rpmfile
with rpmfile.open('file.rpm') as rpm:
# Inspect the RPM headers
print(rpm.headers.keys())
print(rpm.headers.get('arch', 'noarch'))
# Extract a fileobject from the archive
fd = rpm.extractfile('./usr/bin/script')
print(fd.read())
for member in rpm.getmembers():
print(member)
Classes
- rpmfile.RPMFile: The RPMFile object provides an interface to a RPM archive
- rpmfile.RPMInfo: An RPMInfo object represents one member in a RPMFile.
Contributing
The black formater should be used on all files before submitting a contribution.
$ black .
Code in this module was borrowed from:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rpmfile-1.0.2.tar.gz
(13.6 kB
view details)
File details
Details for the file rpmfile-1.0.2.tar.gz
.
File metadata
- Download URL: rpmfile-1.0.2.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b9413f0f53baf2947a60a60b4b8d0bbe4823c117aa2aaa7c04d9a696744e193 |
|
MD5 | 03572d8463d2cfa11dc5278887e81e7f |
|
BLAKE2b-256 | d8a6d173fffd1013ed12d23486041fcdb65899528eb4b4297d5dfdf23bc2ff9d |