Configs is an INI configuration parsing package, written for humans.
Load a config file:
>>> import configs
>>> c = configs.load('sample.conf')
>>> c['general']
{'foo': 'baz'}
Load a config file with a fallback config file (with default values):
>>> fc = configs.load('sample.conf', fallback_file='default.conf')
>>> fc['general']['spam']
eggs
See the full documentation at configs.rtfd.org.
The repo is at bitbucket.org/moigagoo/configs.
This module implements the configs API.
Constructs and returns a Config instance.
Parameters: |
|
---|
Usage:
>>> import configs
>>> fc = configs.load('sample.conf', fallback_file='default.conf')
>>> fc['general']['spam']
eggs
This module contains the Config class.
Bases: builtins.object
Parsed configuration.
Config instance includes a list of Section instances.
This module contains the Section class.
Bases: builtins.object
INI configuration section.
A Section instance stores both key-value and flag items, in dict_props and list_props attributes respectively.
It is possible to iterate over a section; flag values are listed first, then key-value items.