A python package that extracts rpm package information from rpm database.
Why this and not "rpm" I needed a package that could run on environment without rpm shared libraries installable. This leverage go's portability to enable this.
Dependency note: this package is being deprecated in favor of the unified package pygorpmrustinfo. If you depend on this package in another project, update your dependency declaration (for example in requirements, pyproject.toml, setup.cfg, or setup.py) to depend on pygorpmrustinfo instead. The unified package preserves the existing functionality while avoiding the multiple-Go-runtime risk discussed in Go issue #65050 and reducing memory usage.
Example usage
from pyrpmdb import get_rpm_db_info
import json
def test_get_info(file):
res = get_rpm_db_info(file)
print(json.dumps(res, indent=4))
test_get_info("foo/bar")
test_get_info("/usr/bin/du")
test_get_info("test-data/centos5-plain-Packages")
The result returned is always a dict object for errors the dictionary returned contains a key; "error" like;
{
"error": "path error:foo/bar"
}
or
{
"error": "/usr/bin/du: could not read Go build info from /usr/bin/du: unrecognized file format"
}
on success a python list of rpm package info struct is returned of this go structure serialized
{
Epoch *int
Name string
Version string
Release string
Arch string
SourceRpm string
Size int
License string
Vendor string
Modularitylabel string
Summary string
PGP string
SigMD5 string
InstallTime int
BaseNames []string
DirIndexes []int32
DirNames []string
FileSizes []int32
FileDigests []string
FileModes []uint16
FileFlags []int32
UserNames []string
GroupNames []string
Provides []string
Requires []string
}
[
{
"Name": "package_name",
"Version": "version",
"Release": "blah"
}
]
This package relies on a shared go library that leverages https://pkg.go.dev/github.com/knqyf263/go-rpmdb/pkg
So relies on this for database support.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file pyrpmdb-0.1.34.tar.gz.
File metadata
- Download URL: pyrpmdb-0.1.34.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6dd90bee70f5b9d4d2da5db2827e80e2d56f118746497a3f6da514b707b989e
|
|
| MD5 |
085ee764c55f1d5bac0ad7ef038b001c
|
|
| BLAKE2b-256 |
169c0f4b2e61ed809d0380cd652fc837f4f078b039e376aed017a7b352ebc0b8
|
Provenance
The following attestation bundles were made for pyrpmdb-0.1.34.tar.gz:
Publisher:
build_wheels.yml on MikeMoore63/pyrpmdb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyrpmdb-0.1.34.tar.gz -
Subject digest:
a6dd90bee70f5b9d4d2da5db2827e80e2d56f118746497a3f6da514b707b989e - Sigstore transparency entry: 2048613647
- Sigstore integration time:
-
Permalink:
MikeMoore63/pyrpmdb@209d585e3be3b0b8dd6ed25dba5553c2fdef00bc -
Branch / Tag:
refs/tags/v0.1.34 - Owner: https://github.com/MikeMoore63
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
build_wheels.yml@209d585e3be3b0b8dd6ed25dba5553c2fdef00bc -
Trigger Event:
push
-
Statement type: