How kevincrrl/pkgbuild_parser works
pkgbuild_parser is a dependency-free Python library for extracting basic fields from PKGBUILD files. A caller constructs a Parser, which reads and interprets the file; its getters expose package metadata, including architecture-specific values and variable substitution. InfoDict collects selected fields and can serialize them to JSON or write a JSON file. The core and public API excerpts show these runtime responsibilities; broader field coverage is documented in the README.
Main entry points: parser_core.py PKGBUILD reader · pkgbuild_parser.py InfoDict builder
Components 8
Public API
- Parser getters
pkgbuild_parser/pkgbuild_parser.py
Parsing engine
- PKGBUILD reader
pkgbuild_parser/parser_core.py - Variable substitution
pkgbuild_parser/parser_core.py
Info export
- InfoDict builder
pkgbuild_parser/pkgbuild_parser.py - JSON output
pkgbuild_parser/pkgbuild_parser.py
Other components
- Library caller
- PKGBUILD input
- JSON file
Connections 8
- Library caller → Parser getters: constructs and queries
README.md - PKGBUILD input → PKGBUILD reader: provides input
pkgbuild_parser/parser_core.py - Parser getters → PKGBUILD reader: inherits and delegates
pkgbuild_parser/pkgbuild_parser.py - PKGBUILD reader → Variable substitution: processes variables
pkgbuild_parser/parser_core.py - Library caller → InfoDict builder: selects fields
README.md - InfoDict builder → PKGBUILD reader: requests values
pkgbuild_parser/pkgbuild_parser.py - InfoDict builder → JSON output: serializes dictionary
pkgbuild_parser/pkgbuild_parser.py - JSON output → JSON file: writes JSON
pkgbuild_parser/pkgbuild_parser.py