HyperPyYAML
Extensions to YAML syntax for better python interaction
What it is and what it does
HyperPyYAML is a YAML extension library that adds Python-specific syntax to make configuration files more expressive and less repetitive. It lets you instantiate Python objects directly in YAML using `!new:` tags, define reusable references with `!ref` that support string interpolation and nested lookups, and implicitly parse tuples from parenthesized strings. The package depends on pyyaml and ruamel.yaml as runtime dependencies.
It's designed for data-analysis workflows where hyperparameters need to be easily examined, modified, and cross-referenced without cluttering Python code. You load a YAML file with `load_hyperpyyaml()`, optionally override values at runtime, and get back a fully-constructed configuration object with all references resolved and objects instantiated. The trade-off is that loading YAML allows arbitrary code execution—a feature, not a bug, but one that requires you to trust or audit any YAML files you load.
Use it for:
- Define machine-learning experiment hyperparameters in YAML with cross-references that auto-update when you change a base value.
- Instantiate complex nested objects (models, counters, custom classes) directly in configuration files without Python boilerplate.
- Override specific hyperparameters at runtime (e.g., learning rate, batch size) without editing the YAML file itself.
- Share reproducible experiment configs that reference each other and compute derived values via interpolation.
- Avoid scattering magic numbers and object constructors throughout Python analysis code by centralizing them in a single YAML file.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Extends YAML syntax with Python-friendly features like object instantiation, smart aliases with interpolation, and implicit tuple support for cleaner hyperparameter configuration files.
Yes, if you manage hyperparameter-heavy projects and want cleaner, more maintainable config files. The low install friction, permissive license, and active repository make it a safe choice. Be aware that loading YAML executes arbitrary Python code—audit any untrusted configs. Aging maintenance status suggests stable rather than rapidly evolving, which is appropriate for a focused utility.
Install
hyperpyyaml on PyPI
pip
pip install hyperpyyamluv
uv add hyperpyyamlpoetry
poetry add hyperpyyamlInstalling HyperPyYAML
Before you install
Low friction—pure Python wheel with just two YAML library dependencies (pyyaml and ruamel.yaml). Last release was recent; repo is active and not archived, though maintenance status is aging.
License in practice
Licensed under Apache 2.0 (permissive). No restrictions on commercial or private use; attribution required but no copyleft obligations.
Quickstart
pip install hyperpyyaml
from hyperpyyaml import load_hyperpyyaml
yaml_str = """model: !new:collections.Counter
folder: abc/def
ref_folder: !ref /"""
config = load_hyperpyyaml(yaml_str)
print(config['model'])
Loading untrusted YAML files allows arbitrary code execution—verify all YAML sources before loading, as documented in the package's security note.
Verify before relying
- Whether the package works with all modern Python versions (requires_python is unspecified in metadata).
- Current maintenance velocity and whether aging status indicates reduced active development or stable maintenance.
Package facts
| License | not declared (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — pyyaml, ruamel.yaml |
| Maintenance | aging — 225 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,852,618/month — #3,492 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: hyperpyyaml-1.2.3-py3-none-any.whl
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
aspy.yamlProvides order-preserving YAML loading and…
permissive · top 15,000 on PyPI
yamlpathQuery, retrieve, update, merge, validate, and…
permissive · top 15,000 on PyPI
HiYaPyCoLoads and merges multiple YAML configuration…
copyleft · top 15,000 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pyyaml-includeExtends PyYAML to include other YAML files into…
copyleft · top 5,000 on PyPI
yacsYACS is a lightweight configuration management…
permissive · top 5,000 on PyPI
rapidyamlParses and emits YAML documents via a fast C++…
permissive · top 15,000 on PyPI
oyamloyaml is a drop-in replacement for PyYAML that…
permissive · top 5,000 on PyPI
pyamlProduces human-readable, diff-friendly YAML…
permissive · top 5,000 on PyPI
dynamic-yamlAdds dynamic string interpolation to YAML…
permissive · top 15,000 on PyPI