Skip to main content

koji-habitude

koji-habitude is an object management tool for Koji build systems. It provides a declarative approach to managing koji objects through YAML templates and data files.

This project is an offshoot of koji-box, fulfilling the need for populating a boxed koji instance with a bunch of tags and targets. However it is being written such that it can be used with any koji deployment, in the hopes that it may bring joy into the lives of those trying to keep project packagers happy.

Key Features:

  • Define koji objects (tags, external repos, users, targets, hosts, groups, channels, permissions, build types, archive types) in YAML
  • Use Jinja2 templates for dynamic configuration generation
  • Automatically resolve dependencies between objects (tag inheritance)
  • Apply changes in the correct order through tiered execution
  • Validate configurations offline before deployment

Command-Line Interface

koji-habitude provides a comprehensive CLI built with Click for managing Koji objects. The CLI includes:

  • Primary commands: apply, compare, expand, fetch, dump, list-templates, diff, and edit
  • Template subcommands: Work with individual templates using template show, template expand, template compare, template diff, template apply

For detailed CLI documentation with all options, examples, and use cases, see the Command-Line Interface documentation in the full documentation.

YAML Format & Templates

YAML files can be single or multi-document, processed in-order. Each document has a type key indicating the document type. Core types include template, tag, target, user, group, host, channel, permission, content-generator, build-type, archive-type, and external-repo. Templates define new types based on their name.

Templates use Jinja2 for dynamic content generation, allowing you to create reusable patterns for koji objects. When processing data files, objects with type matching a template name trigger template expansion, creating final koji objects through recursive processing.

For complete YAML format documentation and detailed examples, see the YAML Format Specification in the full documentation.

Architecture

koji-habitude supports all core Koji object types with fully implemented Pydantic models: tags, external repos, users, targets, hosts, groups, channels, permissions, content generators, build types, and archive types.

The system automatically detects dependencies between objects (e.g., tag inheritance) and provides intelligent resolution through tiered execution, ensuring objects are processed in the correct order. The architecture includes:

  • Template System: Jinja2-based template expansion with recursive processing
  • Dependency Resolution: Automatic detection and tiered execution ordering
  • Remote Models: Complete set of remote object models for fetching and comparing
  • State Synchronization: State machine-driven processor with multicall integration
  • Change Tracking: Detailed tracking of all modifications with explanations
  • Dry-Run Support: Preview changes without applying them
  • Bidirectional: Fetch remote state to YAML, or dump remote objects by pattern

Data Flow: YAML files → Template expansion → Dependency resolution → Tiered processing → Koji hub

Requirements & Installation

Requirements:

Installation:

pip install -e .

Contact & License

Author: Christopher O'Brien obriencj@gmail.com

Original Git Repository: https://github.com/obriencj/koji-habitude

Documentation: https://obriencj.github.io/koji-habitude

AI Assistance: This project was developed with assistance from Claude (Claude 3.5 and 4.5 Sonnet) via Cursor IDE.

License: GNU General Public License v3 or later. See https://www.gnu.org/licenses/ for details.

Metadata

Release files for koji-habitude 0.9.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for koji-habitude 0.9.0
File Size Uploaded Provenance Actions
koji_habitude-0.9.0.tar.gz 113.2 kB With provenance Details for koji_habitude-0.9.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for koji-habitude 0.9.0
File Interpreter ABI Platform Actions
koji_habitude-0.9.0-py3-none-any.whl Python 3 none any Details for koji_habitude-0.9.0-py3-none-any.whl

Total release size: 218.3 kB

Release files / koji_habitude-0.9.0.tar.gz

Download URL koji_habitude-0.9.0.tar.gz
Size 113.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ea7eeff80cd43979abeecd1342990f4b9ea84810ebe165bce6ba35bc9ec5e54f
BLAKE2b-256 checksum
How to use checksums
c2403a3eca0fd580b99f41a96dadec9d21da2d91524c09a6b22ccefa730a88d6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 29, 2025.

Transparency log

Release files / koji_habitude-0.9.0-py3-none-any.whl

Download URL koji_habitude-0.9.0-py3-none-any.whl
Size 105.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6f20269b4b240b99dd84cb569bb959206c7b9ed0b824c9fb48070949f4cdc184
BLAKE2b-256 checksum
How to use checksums
9a4adac127f37d6de802017bed3b68257056b19f2f262dbdedd556c243d282dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 29, 2025.

Transparency log

Security for koji-habitude 0.9.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for koji_habitude-0.9.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 29, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.9.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page