Python API
OmegaConf's public API centers on the OmegaConf class. Start with an
operation below, then follow the link to its generated signature, parameters,
and return value.
| I want to⦠| Start with |
|---|---|
| Create a config from Python data or YAML | OmegaConf.create() |
| Combine configs, with later values taking precedence | OmegaConf.merge() |
| Read a nested value by path | OmegaConf.select() |
| Write a nested value by path | OmegaConf.update() |
| Convert a config to a Python container | OmegaConf.to_container() |
| Serialize a config to a YAML string | OmegaConf.to_yaml() |
| Resolve interpolations in place | OmegaConf.resolve() |
Helpersβ
Use MISSING to mark a mandatory missing value,
II and SI for
interpolations, and open_dict,
read_write, or
flag_override for temporary flag
changes.
Deprecated functionsβ
In 2.3, OmegaConf.register_resolver()
is deprecated. Use
OmegaConf.register_new_resolver()
instead. This differs from 2.4, where register_resolver() is the canonical API.