skillfed

rpmfile

Read rpm archive files

rpmfile v2.2.1 1.1M downloads/30d#4,371 on PyPI31
Permissive license MIT Active released

What it is and what it does

rpmfile is a Python library for reading and inspecting RPM archive files, designed to mirror the interface of Python's built-in tarfile module. It lets you open an RPM, examine its headers and metadata, list contents, and extract individual files programmatically without needing system RPM tools.

The package supports both standard and zstd-compressed RPM files (the latter requires an optional zstandard dependency). It provides both a Python API for programmatic access and command-line tools for listing, extracting, and displaying RPM information. The library has been maintained since 2014 and currently supports Python 3.10 through 3.14.

Use it for:

  • Extract specific files from RPM packages in build or deployment automation scripts.
  • Inspect RPM headers and metadata without installing the package on the system.
  • Parse RPM contents in CI/CD pipelines to validate package structure or contents.
  • Read RPM files from remote sources via stdin in shell pipelines.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Inspect and extract files from RPM archive files using a Python API modeled after the standard tarfile module.

Yes. Low install friction, no runtime dependencies, active maintenance, MIT license, and zero known vulnerabilities make this a safe choice. Install it if you need to programmatically work with RPM files in Python without relying on system RPM tools.

Install

rpmfile on PyPI

pip

pip install rpmfile

uv

uv add rpmfile

poetry

poetry add rpmfile

Installing rpmfile

Before you install

Low friction installation with no runtime dependencies. Active maintenance with recent commits and a stable release history since 2014.

License in practice

MIT license permits unrestricted use, modification, and distribution with minimal legal constraint.

Quickstart

import rpmfile

with rpmfile.open('file.rpm') as rpm:
    print(rpm.headers.keys())
    fd = rpm.extractfile('./usr/bin/script')
    print(fd.read())

Requires Python >= 3.10; optional zstandard module needed for zstd-compressed RPMs.

Verify before relying

  • Whether zstandard is truly optional or required for common RPM variants in practice.
  • Performance characteristics when handling large RPM files or batch extraction.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance actively maintained — 100 days since the last release
Last repo commit
First released
Downloads 1,099,790/month — #4,371 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: rpmfile-2.2.1-py3-none-any.whl

Intended Audience :: DevelopersNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

read rpm files pythonextract rpm archiveinspect rpm metadatarpm file parserrpm archive toolsrpm extraction library
rpm-archivepackage-inspection

More Utilities packages