rpmfile
Read rpm archive files
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 rpmfileuv
uv add rpmfilepoetry
poetry add rpmfileInstalling 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
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
tzsttzst creates and extracts tar archives…
permissive · top 15,000 on PyPI
backports.tarfileProvides a backport of Python's tarfile module…
permissive · top 1,000 on PyPI
fastarFastar provides high-performance tar archive…
permissive · top 1,000 on PyPI
unix-arReads and writes AR archive files (Unix static…
permissive · top 5,000 on PyPI
rpmProvides access to system RPM Python bindings…
permissive · top 15,000 on PyPI
extractcodeExtracts a wide range of archive formats (tar,…
permissive · top 15,000 on PyPI
securetarSecure Tar wraps Python's tarfile module to add…
permissive · top 15,000 on PyPI
kojiKoji is a command-line client and library for…
copyleft · top 15,000 on PyPI
rpm-vercmpCompares RPM package version strings using the…
permissive · top 15,000 on PyPI
version-utilsParses and compares package version strings in…
copyleft · top 15,000 on PyPI