Goodconf is a yaml based configuration library, supporting dot access, deep updates and more.
Loading from a string:
s = 'hello: world'
c = Config.from_string(s)
assert c.hello == 'world'
assert c == {'hello': 'world'}
Loading from a file: config.yaml:
env_name: 'MBRLCartpole-v0'
num_trials: 1
train_timesteps: 200
render: False
training:
batch_size: 128
c = Config.from_file('conf/config.yaml')
assert c.env_name == 'MBRLCartpole-v0'
assert c.training == 128
You can override configuration values:
c = config.Config.from_file('conf/config.yaml')
c.update('env_name', 'NewEnv-v2')
c.update('training.batch_size', 256)