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.3.tar.gz
(15.4 kB
view details)
File details
Details for the file rpmfile-1.0.3.tar.gz
.
File metadata
- Download URL: rpmfile-1.0.3.tar.gz
- Upload date:
- Size: 15.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c27be5433968c47f5715703013964639a86233640d005987ac1f4e69d795e5e |
|
MD5 | bab19142444dfa948f73366a1f3e3366 |
|
BLAKE2b-256 | aedd13e9ad039348012bb159cbf1f77113818adce27b6675a099bcbb7fddaf58 |