Skip to main content

A library for parsing RPM repository metadata.

Project description

rpmrepo_metadata

rpmrepo_metadata is a library for manipulating, reading and writing RPM repositories.

Installation

pip install rpmrepo_metadata

Note: requires Python >= 3.7.

Example

In [1]: from rpmrepo_metadata import RepositoryReader

In [2]: reader = RepositoryReader("tests/assets/external_repos/centos7/")

In [3]: packages = reader.iter_packages()

In [4]: packages.total_packages
Out[4]: 10072

In [5]: next(packages)
Out[5]: <Package at 0x5613b8983cb0>

In [6]: packages.remaining_packages
Out[6]: 10071

In [7]: for pkg in packages:
   ...:     print(pkg.nevra())
389-ds-base-0:1.3.10.2-6.el7.x86_64
389-ds-base-devel-0:1.3.10.2-6.el7.x86_64
389-ds-base-libs-0:1.3.10.2-6.el7.x86_64
389-ds-base-snmp-0:1.3.10.2-6.el7.x86_64
Cython-0:0.19-5.el7.x86_64
ElectricFence-0:2.2.2-39.el7.i686
ElectricFence-0:2.2.2-39.el7.x86_64
...
...

Development

Setup

  1. Install Rust / Cargo
  2. Create and activate a Python virtual environment
  3. maturin develop

Testing

To run the native Rust tests, cargo test

To run the validation tests against createrepo_c, first install createrepo_c and pytest in your virtual environment

pytest -vv tests/validate_against_createrepo_c.py

To test a specific repo

pytest -vv tests/validate_against_createrepo_c.py::validate_ecosystem_repo\[centos7\]

Building an RPM

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

rpmrepo_metadata-0.1.0.post3.tar.gz (54.4 kB view details)

Uploaded Source

File details

Details for the file rpmrepo_metadata-0.1.0.post3.tar.gz.

File metadata

  • Download URL: rpmrepo_metadata-0.1.0.post3.tar.gz
  • Upload date:
  • Size: 54.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.6.3 pkginfo/1.8.2 requests/2.27.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.10.2

File hashes

Hashes for rpmrepo_metadata-0.1.0.post3.tar.gz
Algorithm Hash digest
SHA256 d677fe528dc68ba24f19b3c41b17d1a718b3b2590b30a47d9c2264768eae3d57
MD5 21549aa1e2cbf8f2527160689dd03d5d
BLAKE2b-256 fe943f0d79373295ddecf5bf11d3fc10502313aee0eaf8cd7cef76918632e3e0

See more details on using hashes here.

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