A Python library that enables features such as inheritance, variables, and instantiation in YAML files.
Project description
yaml_quilt
A Python library that enables inheritance, variables, and instantiation in YAML files via inline declarations.
Installation
pip install yaml_quilt
Overview
YamlQuilt is a Python library that allows templating of YAML files using inline declarations and depth-first search (DFS) traversal. This is accomplished through three key features: Variables, File Inheritance, and Declarative Rules. These declaration rules include inheritance rules such as abstract, sealed, private, etc and variable replacement rules such as default, optional, global, etc. The DFS approach allows declarative rules to persist to child elements, even across inherited files.
YamlQuilt aims for yaml readability by avoiding {{ Helm-style }} templating and in-line programming logic. YamlQuilt's in-line declarations use a minimal format that always places declaration in the beginning of an element. YamlQuilt eliminates templating logic in Python and and calls YAML files the same way you would pyyaml's load():
import yaml
from yaml_quilt import stitch, YamlQuiltException
# Define variables in Python code
injected_variables = {
"<var1>": "value1"
}
# Process YAML with injected variables
try:
result = stitch(
file_path="root_config.yaml",
directory="/path/to/config",
Loader=yaml.SafeLoader,
variables=injected_variables
)
except YamlQuiltException as e:
print(f"Error: {e}")
Processing behavior is defined within the Yaml file via in-line declarations.
# config.yaml
(patch): config_path/patch.yaml
(override) base_key1: <variable1>
---
# patch.yaml
(abstract) base_key1:
base_key2: value2
---
# yaml_quilt output
base_key1: value1
base_key2: value2
Documentation
Full documentation is available at https://eshen2210.github.io/yaml_quilt/.
License
MIT License
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yaml_quilt-0.1.0.tar.gz.
File metadata
- Download URL: yaml_quilt-0.1.0.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
65f7e67d69c4e23f7c2b5caaeb8c9f3bc8d6cf28bccc45284a6fce666c770ee1
|
|
| MD5 |
bb85e37ff015265ec76acd836c003f86
|
|
| BLAKE2b-256 |
a4fb1c79fd661a8f3bea5967b6f0925f31dbc287fea7b8c4f183259a907d42cb
|
Provenance
The following attestation bundles were made for yaml_quilt-0.1.0.tar.gz:
Publisher:
python-app.yaml on eshen2210/yaml_quilt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yaml_quilt-0.1.0.tar.gz -
Subject digest:
65f7e67d69c4e23f7c2b5caaeb8c9f3bc8d6cf28bccc45284a6fce666c770ee1 - Sigstore transparency entry: 1344333530
- Sigstore integration time:
-
Permalink:
eshen2210/yaml_quilt@6b73fb957b807015f5fc883b33594f46581495db -
Branch / Tag:
refs/heads/main - Owner: https://github.com/eshen2210
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-app.yaml@6b73fb957b807015f5fc883b33594f46581495db -
Trigger Event:
push
-
Statement type:
File details
Details for the file yaml_quilt-0.1.0-py3-none-any.whl.
File metadata
- Download URL: yaml_quilt-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
98d74f19b52df90f9d81e9dd7b00db063e0cfc47001ca36b55918e8b59fb5f8c
|
|
| MD5 |
aeeec7cd412c36d7177495823845417f
|
|
| BLAKE2b-256 |
26d8623e5511d278b1fc9bab9d69b2a6927a1575a8b42b858de2ec9463627505
|
Provenance
The following attestation bundles were made for yaml_quilt-0.1.0-py3-none-any.whl:
Publisher:
python-app.yaml on eshen2210/yaml_quilt
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
yaml_quilt-0.1.0-py3-none-any.whl -
Subject digest:
98d74f19b52df90f9d81e9dd7b00db063e0cfc47001ca36b55918e8b59fb5f8c - Sigstore transparency entry: 1344333619
- Sigstore integration time:
-
Permalink:
eshen2210/yaml_quilt@6b73fb957b807015f5fc883b33594f46581495db -
Branch / Tag:
refs/heads/main - Owner: https://github.com/eshen2210
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-app.yaml@6b73fb957b807015f5fc883b33594f46581495db -
Trigger Event:
push
-
Statement type: