PURPOSE
- to provide unified way to configure
python2andpython3application - to be handy for developers, devops, QA and users with technical background
READINGS
- yaml tutorial
- http://yaml.org/spec/1.1/
- YAML IS NOT A JSON AND NOT A DATA SERIALIZATION FORMAT. ITS A OBJECT SERIALIZATION FORMAT
REQUIREMENTS
- MUST support yaml out of the box
- MUST configure program (standalone module or python package) by recursive merge developer defined configuration (defaults) and runtime provided configuration.
- each configuration layer (e.g. defaults, runtime config, etc.) MUST be a nested mapping
- number of merged layers is unlimited and MAY be redefined by developer
- layer merge order MAY be redefined by developer
- MUST contain set of yaml constructors
!url!date!datetime!timedelta!strjoin!envvar!regexp!filecontent
- SHOULD contain set of dangerous yaml constructors
!file!socket!yamlfile- includes yaml by file path or url
- MAY process constructors with recursion detection (see REQUIREMENT NOTES)
- MAY contain cli arg mapping constructors
- SHOULD provide a way to extend set of constructors before configuration loaded
- MUST provide a way to configure logging using
logging.dictConfigand values from merged configuration - runtime configuration path MAY be redefined with envvar (like
$ CONFIG=./some-config.yml program.py) - runtime configuration path MAY be redefined with cli arg (like
$ program.py --config=./some-config.yml) - SHOULD enable sharing of anchors between layers
- SHOULD NOT allow to redefine anchors that alredy defined in previous layers
- MUST support filesystem path as configuration path
- MUST support
file://,http(s)://urls as configuration path - MAY support
ftp://urls as configuration path - MAY support
git://urls as configuration path
REQUIREMENT NOTES
!class,!object, and!yamlfileare considered dangerous since class or object creation may require existing configuration that is not exists during constructor call.!yamlfilecan refer!classor!objectinside and/or cause infinte yaml load recursion or module load recursion.!fileand!socketare considered dangerous since they are not serializable
IMPLEMENTATION
- provides
<module>.<config>submodule that contains resulting configuration as mapping
???
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
devconfig-0.4.8.tar.gz
(19.1 kB
view details)
File details
Details for the file devconfig-0.4.8.tar.gz.
File metadata
- Download URL: devconfig-0.4.8.tar.gz
- Upload date:
- Size: 19.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.7.1 requests-toolbelt/0.9.1 tqdm/4.33.0 CPython/3.7.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4eb067212f3736f542341d37b877452cc658fbfcbdc9301297d9d6451b9f309c
|
|
| MD5 |
b2e33e80066c9bf8135f2fcb3bbcaa08
|
|
| BLAKE2b-256 |
9e4aa87ee48365b592aac5de6d3cfd58d78e2552c7cc601545795c32a41f2387
|