Skip to main content

python module for parsing, validating and querying distribution/packaging metadata stored in human readable and reviewable text/YAML files

Project description

# distroinfo

`distroinfo` is a python module for parsing, validating and querying
distribution/packaging metadata stored in human readable and reviewable
text/YAML files.

This is a proper generic (re)implementation of
[rdoinfo]( parser which proved
well suited for the task of interfacing with distribution metadata in a human
friendly way. If you consider code reviews human friendly, that is.

`distroinfo` is a part of
[Software Factory project](


`distroinfo` is available from Fedora/EPEL repos and is **BEING INTEGRATED**.

[rdopkg]( and
[DLRN]( are first adopters.

`rdoinfo` compatibility is ensured through offline and online tests.

CI is enabled.

See [distroinfo reviews](

Use github
to make requests and report bugs.

Poke `jruzicka` on `#softwarefactory` or `#rdo` Freenode IRC for more

## Installation

### from source

If you want to hack `distroinfo` or just have the latest code without waiting
for next release, you can use the git repo directly:

git clone
cd distroinfo
python develop --user

You may set the preference over `distroinfo` RPM by correctly positioning
`~/.local/bin/distroinfo` in your `$PATH`.

Or you can use virtualenv to avoid conflicts with RPM:

git clone
cd distroinfo
virtualenv --system-site-packages ~/distroinfo-venv
source ~/distroinfo-venv/bin/activate
python develop
ln `which distroinfo` ~/bin/distroinfo-dev

distroinfo-dev --version

Required python modules are listed in

### from Fedora/EPEL repos (default)

`distroinfo` is available on **Fedora 27** and newer:

dnf install python2-distroinfo

including Python 3 version:

dnf install python3-distroinfo

On CentOS/RHEL 7, `distroinfo` is available from

On **CentOS 7**:

yum install epel-release
yum install python2-distroinfo

On **RHEL 7**:

yum install
yum install python2-distroinfo

### from PyPI

For your convenience, `distroinfo` is available from the Cheese Shop:

pip install distroinfo

## Usage

You can **fetch info files from an URL** by specifying `remote_info` base URL:

from import DistroInfo


di = DistroInfo('rdo-full.yml',
info = di.get_info()

Or you can **fetch info files from a remote git repository** using

from import DistroInfo


di = DistroInfo('rdo-full.yml',
info = di.get_info()

Or you can **fetch info files from a local directory** using

from import DistroInfo

INFO_PATH = '/path/to/info'

di = DistroInfo('rdo-full.yml',
info = di.get_info()

For remote fetchers info files/repos are cached in `~/.distroinfo/cache`.

You can navigate info structure yourself or use `query` module:

from distroinfo import query

# get a package info by strict package name
nova = query.get_package(info, 'openstack-nova')

# find a package by human reference (smart search)
keystone = query.find_package(info, 'keystone')

Alternatively, you can get info with `packages` and `releases` as dictionaries
indexed by project/release name for easier access using `info_dicts=True`:

info = di.get_info(info_dicts=True)
nova = info['packages']['nova']

Until proper documentation is in place, please refer to:

* [rdoinfo]( for prime example of
`distroinfo` format usage
* [rdoinfo integration tests](
for code examples
* [dlrn.drivers.rdoinfo](
for a real world code that uses tags and `remote_git_info`/`local_info`
* [](

## Command Line Interface

A simple CLI is provided in `scripts/` which can be used to test basic
`distroinfo` functionality, profile, dump parsed data, etc.

An example of dumping parsed rdoinfo into both YAML and JSON files:

$> ./scripts/ dump -y rdoinfo.yaml -j rdoinfo.json -f git \
'' rdo-full.yml

Dumping YAML to: rdoinfo.yaml
Dumping JSON to: rdoinfo.json

Additional `docopt` module is required to run the CLI.

## Bugs

Please use the
[github Issues](
to report bugs.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for distroinfo, version 0.3.0
Filename, size & hash File type Python version Upload date
distroinfo-0.3.0-py2-none-any.whl (16.1 kB) View hashes Wheel py2
distroinfo-0.3.0.tar.gz (72.5 kB) View hashes Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page