Skip to main content

A utility to extract rpm package information from rpm database

Project description

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.

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

{
    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 spackage 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.

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

pyrpmdb-0.1.20.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distributions

pyrpmdb-0.1.20-pp310-pypy310_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyrpmdb-0.1.20-pp310-pypy310_pp73-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pyrpmdb-0.1.20-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyrpmdb-0.1.20-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pyrpmdb-0.1.20-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyrpmdb-0.1.20-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pyrpmdb-0.1.20-pp37-pypy37_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view hashes)

Uploaded PyPy manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyrpmdb-0.1.20-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

pyrpmdb-0.1.20-cp312-cp312-musllinux_1_1_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.12 musllinux: musl 1.1+ x86-64

pyrpmdb-0.1.20-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyrpmdb-0.1.20-cp312-cp312-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.12 macOS 10.9+ x86-64

pyrpmdb-0.1.20-cp311-cp311-musllinux_1_1_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.11 musllinux: musl 1.1+ x86-64

pyrpmdb-0.1.20-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyrpmdb-0.1.20-cp311-cp311-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.11 macOS 10.9+ x86-64

pyrpmdb-0.1.20-cp310-cp310-musllinux_1_1_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.10 musllinux: musl 1.1+ x86-64

pyrpmdb-0.1.20-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyrpmdb-0.1.20-cp310-cp310-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.10 macOS 10.9+ x86-64

pyrpmdb-0.1.20-cp39-cp39-musllinux_1_1_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.9 musllinux: musl 1.1+ x86-64

pyrpmdb-0.1.20-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyrpmdb-0.1.20-cp39-cp39-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

pyrpmdb-0.1.20-cp38-cp38-musllinux_1_1_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.8 musllinux: musl 1.1+ x86-64

pyrpmdb-0.1.20-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyrpmdb-0.1.20-cp38-cp38-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

pyrpmdb-0.1.20-cp37-cp37m-musllinux_1_1_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.7m musllinux: musl 1.1+ x86-64

pyrpmdb-0.1.20-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyrpmdb-0.1.20-cp37-cp37m-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

pyrpmdb-0.1.20-cp36-cp36m-musllinux_1_1_x86_64.whl (2.9 MB view hashes)

Uploaded CPython 3.6m musllinux: musl 1.1+ x86-64

pyrpmdb-0.1.20-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64 manylinux: glibc 2.5+ x86-64

pyrpmdb-0.1.20-cp36-cp36m-macosx_10_9_x86_64.whl (3.0 MB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

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