Skip to main content
Fingi, the OmegaConf mascotFingi, the OmegaConf mascot

OmegaConf

Flexible configuration for Python. Create configs from Python or YAML, merge configuration sources, use interpolation and resolvers, and validate values with structured configs.

Documentation for stable 2.3 · 2.4 prerelease

config.pyPython
from omegaconf import OmegaConf

base = OmegaConf.create({
"host": "localhost",
"port": 80,
"url": "http://${host}:${port}",
})
override = OmegaConf.create({
"port": 8080,
})
config = OmegaConf.merge(base, override)
print(config.url)
Outputhttp://localhost:8080

Explore the documentation