Library for reading dnf/yum repositories
Project description
repomd
This library provides an object-oriented interface to get information out of dnf/yum repositories.
Usage
>>> import repomd
>>> repo = repomd.load('https://mirror.rackspace.com/centos/7/updates/x86_64/')
>>> repo
<Repo: "https://mirror.rackspace.com/centos/7/updates/x86_64/">
The length of the Repo
object indicates the number of packages in the repository.
>>> len(repo)
1602
Find a package by name.
>>> repo.find('systemd')
<Package: "systemd-219-57.el7_5.3.x86_64">
Find all packages of a given name.
>>> repo.findall('systemd')
[<Package: "systemd-219-57.el7_5.1.x86_64">, <Package: "systemd-219-57.el7_5.3.x86_64">]
A Package
instance has many useful properties.
>>> package = repo.find('systemd')
>>> package.name
'systemd'
>>> package.version
'219'
>>> package.build_time
datetime.datetime(2018, 9, 26, 14, 11, 37)
>>> package.nevr
'systemd-219-57.el7_5.3'
Iterate through packages in the repository.
>>> for package in repo:
... print(package.nvr)
389-ds-base-1.3.7.5-19.el7_5
389-ds-base-1.3.7.5-21.el7_5
389-ds-base-1.3.7.5-24.el7_5
(and so on)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
repomd-0.2.1.tar.gz
(7.7 kB
view hashes)
Built Distribution
repomd-0.2.1-py3-none-any.whl
(3.9 kB
view hashes)