All Projects → srossross → rpmfile

srossross / rpmfile

Licence: MIT license
Read rmp archive files

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to rpmfile

RxLogs
An Android & Kotlin Reactive Advanced Logging Framework.
Stars: ✭ 12 (-29.41%)
Mutual labels:  zipfile
deezer-linux
An universal linux port of deezer, supporting both Flatpak and AppImage
Stars: ✭ 141 (+729.41%)
Mutual labels:  rpm
rpm-adapter
Turns your data storage into an RPM repository
Stars: ✭ 21 (+23.53%)
Mutual labels:  rpm
nginx-more
Development repository for nginx-more package
Stars: ✭ 96 (+464.71%)
Mutual labels:  rpm
prometheus-rpm
RPM packages for Prometheus
Stars: ✭ 35 (+105.88%)
Mutual labels:  rpm
copr-build-bazel
copr build of bazel | https://copr.fedorainfracloud.org/coprs/vbatts/bazel/
Stars: ✭ 14 (-17.65%)
Mutual labels:  rpm
spec-cleaner
spec-cleaner
Stars: ✭ 26 (+52.94%)
Mutual labels:  rpm
foreman-packaging
Packaging files (RPMs, debs) for Foreman and its dependencies
Stars: ✭ 38 (+123.53%)
Mutual labels:  rpm
ungoogled-chromium-fedora
RPM build for ungoogled-chromium
Stars: ✭ 24 (+41.18%)
Mutual labels:  rpm
LAMPP-Manager
A simple LAMPP manager designed to automate all the work.
Stars: ✭ 117 (+588.24%)
Mutual labels:  rpm
copr-rpm-spec
My RPM specs on Copr
Stars: ✭ 17 (+0%)
Mutual labels:  rpm
Boostnote-packages
Repo containing .rpm, .deb and Boostnote app folder
Stars: ✭ 31 (+82.35%)
Mutual labels:  rpm
ATtiny13-TinyTacho
Simple RPM-Meter
Stars: ✭ 36 (+111.76%)
Mutual labels:  rpm
awx-rpm
RPM specs for ansible-awx project
Stars: ✭ 41 (+141.18%)
Mutual labels:  rpm
sle2docker
This is a tool which facilitates the creation of SLE containers for Docker.
Stars: ✭ 39 (+129.41%)
Mutual labels:  rpm
rabbitmq-server-release
RabbitMQ packaging and release engineering bits that do not belong to the Concourse pipelines.
Stars: ✭ 13 (-23.53%)
Mutual labels:  rpm
st2-packages
StackStorm deb/rpm packages (automated docker build pipeline)
Stars: ✭ 25 (+47.06%)
Mutual labels:  rpm
package-build
A toolset for building system packages using Docker and fpm-cookery
Stars: ✭ 36 (+111.76%)
Mutual labels:  rpm
abrute
Multi-threaded AES Brute Force File Decryption
Stars: ✭ 22 (+29.41%)
Mutual labels:  zipfile
fasterzip
A faster python zipfile.
Stars: ✭ 30 (+76.47%)
Mutual labels:  zipfile

rpmfile

Build Status Actions Status PyPI version

Tools for inspecting RPM files in python. This module is modeled after the tarfile module.

Install

$ python -m pip install -U rpmfile

If you want to use rpmfile with zstd compressed rpms, you'll need to install the zstandard module.

zstd also requires that you are using Python >= 3.5

$ python -m pip install -U zstandard

Example

See the tests for more examples.

import rpmfile

with rpmfile.open('file.rpm') as rpm:

    # Inspect the RPM headers
    print(rpm.headers.keys())
    print(rpm.headers.get('arch', 'noarch'))

    # Extract a fileobject from the archive
    fd = rpm.extractfile('./usr/bin/script')
    print(fd.read())

    for member in rpm.getmembers():
        print(member)

Command line usage

You can use rpmfile via it's module invocation or via rpmfile command if your PATH environment variable is configured correctly. Pass --help for all options.

List RPM contents

curl -sfL 'https://example.com/some.rpm.gz' | gzip -d - | python -m rpmfile -l -
./path/to/file

Extract files

curl -sfL 'https://example.com/some.rpm.gz' | gzip -d - | rpmfile -xv -
./path/to/file

Extract files to directory

curl -sfL 'https://example.com/some.rpm.gz' | gzip -d - | rpmfile -xvC /tmp -
/tmp/path/to/file

Display RPM information (similar to command rpm -qip in Linux)

curl -sfL 'https://example.com/some.rpm.gz' |gzip -d - | rpmfile -i -
Name        : something
Version     : 1.02
Release     : 1
Architecture: noarch
Group       : default
Size        : 1234
License     : BSD
Signature   : None
Source RPM  : some.src.rpm
Build Date  : Tue Apr  9 08:55:16 2019
Build Host  : demo
URL         : http://example.com/some
Summary     : Example of something
Description : 
The description of something.
It can display more than one line.

Classes

  • rpmfile.RPMFile: The RPMFile object provides an interface to a RPM archive
  • rpmfile.RPMInfo: An RPMInfo object represents one member in a RPMFile.

Contributing

The black formater should be used on all files before submitting a contribution. Version 19.10b0.

$ pip install black==19.10b0
$ black .

Code in this module was borrowed from:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].