onlineconf
python library for reading configuration files generated by OnlineConf.
- read config from CDB file with scheduled reloading
- supported value formats: string, JSON
- command line tool for converting config from YAML to CDB format
Clone the repository and execute:
python setup.py install
import asyncio
from onlineconf import Config
async def main():
config = await Config.read(filename='config.cdb', reload_interval=30)
value = config.get('/service/param_name')
print(value)
await config.shutdown()
asyncio.run(main())
fill_config config.yaml config.cdb
service:
first_level:
second_level:
string: string_value
integer: 100 # returned as string
float: 1.25 # returned as string
json_list: [first_value, second_value] # returned as python list
json: > # returned as python dict
{
"param": "value"
}
python -m unittest tests