API Reference¶
- class pymlconf.Mergable(data=None)[source]¶
Base class for all configuration nodes.
So all configuration nodes are mergable.
- Parameters
data (list or dict) – Initial value to constract a mergable instance. It can be
yaml stringor python dictionary. default: None.
- abstract canmerge(data)[source]¶
Determine whenever can merge with the passed argument or not.
- Parameters
data (any) – An object to test.
- Returns
bool
- class pymlconf.MergableList(*args, **kwargs)[source]¶
Bases:
list,pymlconf.models.MergableConfiguration node that represents the python list data.
- class pymlconf.MergableDict(*args, **kwargs)[source]¶
Bases:
collections.OrderedDict,pymlconf.models.MergableConfiguration node that represents python dictionary data.
- class pymlconf.ConfigurationNamespace(*args, **kwargs)[source]¶
Bases:
pymlconf.models.MergableDictConfiguration node that represents the configuration namespace node.
- class pymlconf.Root(*args, **kwargs)[source]¶
Bases:
pymlconf.models.MergableDictThe main class which exposes pymlconf package.
Example:
from pymlconf import Root from os import path config = Root(''' server: host: localhost port: 4455 ''') print config.server.host print config.server.port