Python library to parse makedeb-styled SRCINFO files
Project description
makedeb-srcinfo
makedeb-srcinfo
is a Python library to aid in the parsing of makedeb-styled SRCINFO files.
Installation
Install the makedeb-srcinfo
package from PyPI:
pip install makedeb-srcinfo
Usage
from makedeb_srcinfo import SrcinfoParser
with open(".SRCINFO", "r") as file:
data = file.read()
# Parse a SRCINFO file.
srcinfo = SrcinfoParser(data)
# Get all references of a variable (returned in a tuple).
pkgname = srcinfo.get_variable("pkgname")
arch = srcinfo.get_variable("arch")
# Get all references of a variable plus it's extensions (i.e. 'depends' and 'focal_depends').
# Results are returned in a dict with a tuple of (distro, arch) for the key name:
# {
# ("focal", None): ("gimp", "krita"),
# ("focal", "amd64"): ("gcc", "golang-go")
# }
depends = srcinfo.get_extended_variable("depends")
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
makedeb-srcinfo-0.2.0.tar.gz
(15.4 kB
view hashes)
Built Distribution
Close
Hashes for makedeb_srcinfo-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c9bdac983ec7cf40f1c117bd5d6a296c30458f638b50b0db32f9803d0839760 |
|
MD5 | b62cc7a5569f1a1b183baa35866ee2f5 |
|
BLAKE2b-256 | a4e638f8ac27e86d589477102c14bd73bb77b2be78fbb87701bd6f24697b651e |