hya
raw JSON → 0.4.0 verified Fri May 01 auth: no python
hya is a library of custom OmegaConf resolvers, providing utilities for configuration management in Python. Current version 0.4.0, released August 2024. Maintained and updated as needed.
pip install hya Common errors
error ModuleNotFoundError: No module named 'hya' ↓
cause hya not installed
fix
Run pip install hya
error Resolver 'env' not registered ↓
cause hya import not executed before OmegaConf instance creation
fix
Add 'import hya' before creating OmegaConf configuration object.
Warnings
gotcha hya requires Python >=3.10 and OmegaConf installed separately. ↓
fix Ensure Python 3.10+ and install OmegaConf: pip install omegaconf
gotcha Importing hya without using its resolvers may cause confusion; resolvers are registered on import. ↓
fix Explicitly import hya before creating OmegaConf instances to ensure resolvers are registered.
Imports
- hya
import hya
Quickstart
import os
from omegaconf import OmegaConf
# Register hya resolvers
import hya
# Example usage with OmegaConf
cfg = OmegaConf.create("""
name: "hello_${env:HOME}"
""")
# Ensure resolvers are available
OmegaConf.resolve(cfg)
print(cfg.name)