Install & Compatibility
Where this runs
tested against v2.0.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.150s · 19.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.7s · import 0.144s · 21MB
18MB installed
● package 18MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
DynamicYamlLoader
✓ from dynamic_yaml import DynamicYamlLoader
✗ from dynamic_yaml import DynamicYaml
load
✓ from dynamic_yaml import load
dump
✓ from dynamic_yaml import dump
Demonstrates loading a YAML string with self-referential keys and accessing the dynamically resolved values. It also shows how updating a referenced parameter automatically re-resolves dependent values, a feature introduced in v1.1.0.
import os
import yaml
from dynamic_yaml import DynamicYaml, load
# Simulate a YAML file content
yaml_content = """
project_name: hello-world
dirs:
home: /home/user
venv: "{dirs.home}/venvs/{project_name}"
bin: "{dirs.venv}/bin"
output: "{dirs.venv}/output-{parameters.parameter1}"
parameters:
parameter1: test_value
"""
# Load the YAML content, enabling dynamic resolution
config = load(yaml_content)
# Access resolved values using attribute access
print(f"Project Name: {config.project_name}")
print(f"Virtual Environment Path: {config.dirs.venv}")
print(f"Output Path: {config.output}")
# Demonstrate changing a parameter and re-resolving (dynamic update)
config.parameters.parameter1 = "new_test"
print(f"Updated Output Path after parameter change: {config.output}")
Upgrade
Version history
2.0.0latest on PyPI · released Apr 9, 2024
Audit
Dependencies
PyYAMLrequiredRequired for underlying YAML parsing and manipulation.