Skip to content
Read rmp archive files
Python
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.settings
rpmfile Merge pull request #22 from devmonkey22/master Jul 2, 2019
tests Resolves #21 to properly let context manager autoclose RPM file May 15, 2019
.gitignore tests: Move to own directory Apr 25, 2019
.project
.pydevproject
.travis.yml
LICENSE
README.md
setup.py

README.md

rpmfile

Build Status

Tools for inspecting RPM files in python. This module is modeled after the tarfile module.

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.

Code in this module was borrowed from:

You can’t perform that action at this time.