Skip to main content

Read rpm archive files

Project description

rpmfile

Build Status Actions Status PyPI version

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


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.4.tar.gz (16.1 kB view details)

Uploaded Source

File details

Details for the file rpmfile-1.0.4.tar.gz.

File metadata

  • Download URL: rpmfile-1.0.4.tar.gz
  • Upload date:
  • Size: 16.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.52.0 CPython/3.8.6

File hashes

Hashes for rpmfile-1.0.4.tar.gz
Algorithm Hash digest
SHA256 4e5ece00039d12cb960ded1992a274bca8c80d2993253d542ec0bff3f9828586
MD5 1f37ab8ad87d05083c163e30c980a305
BLAKE2b-256 7ecdc7984ec11481742565998c9a1e993b915b80a7a7915badef759770a49b37

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page