Public APIs of anyconfig module.
Changed in version 0.3: Replaced forced_type optional argument of some public APIs with ac_parser to allow skip of config parser search by passing parser object previously found and instantiated.
Also removed some optional arguments, ignore_missing, merge and marker, from definitions of some public APIs as these may not be changed from default in common use cases.
Changed in version 0.2: Now APIs find_loader(), single_load(), multi_load(), load() and dump() can process a file/file-like object or a list of file/file-like objects instead of a file path or a list of file paths.
New in version 0.2: Export factory method (create) of anyconfig.mergeabledict.MergeableDict
Parameters: | level – Log level, e.g. logging.INFO and logging.WARN. |
---|
Find out config parser object appropriate to load from a file of given path or file/file-like object.
Parameters: |
|
---|---|
Returns: | Config parser instance or None |
Load single config file.
Parameters: |
|
---|---|
Returns: | Dict-like object (instance of anyconfig.mergeabledict.MergeableDict by default) supports merge operations. |
Load multiple config files.
The first argument paths may be a list of config file paths or a glob pattern specifying that. That is, if a.yml, b.yml and c.yml are in the dir /etc/foo/conf.d/, the followings give same results:
multi_load(["/etc/foo/conf.d/a.yml", "/etc/foo/conf.d/b.yml",
"/etc/foo/conf.d/c.yml", ])
multi_load("/etc/foo/conf.d/*.yml")
Parameters: |
|
---|---|
Returns: | Dict-like object (instance of anyconfig.mergeabledict.MergeableDict by default) supports merge operations. |
Load single or multiple config files or multiple config files specified in given paths pattern.
Parameters: |
|
---|---|
Returns: | Dict-like object (instance of anyconfig.mergeabledict.MergeableDict by default) supports merge operations. |
Parameters: |
|
---|---|
Returns: | Dict-like object (instance of anyconfig.mergeabledict.MergeableDict by default) supports merge operations. |
Save data as path_or_stream.
Parameters: |
|
---|
Return string representation of data in forced type format.
Parameters: |
|
---|---|
Returns: | Backend-specific string representation for the given data |