Skip to main content

Configuration handling for developers

Project description

rfc2119 for keywords

PURPOSE

  • to provide unified way to configure python2 and python3 application
  • to be handy for developers, devops, QA and users with technical background

READINGS

REQUIREMENTS

  1. MUST support yaml out of the box
  2. MUST configure program (standalone module or python package) by recursive merge developer defined configuration (defaults) and runtime provided configuration.
  3. each configuration layer (e.g. defaults, runtime config, etc.) MUST be a nested mapping
  4. number of merged layers is unlimited and MAY be redefined by developer
  5. layer merge order MAY be redefined by developer
  6. MUST contain set of yaml constructors
    • !url
    • !date
    • !datetime
    • !timedelta
    • !strjoin
    • !envvar
    • !regexp
    • !filecontent
  7. SHOULD contain set of dangerous yaml constructors
    • !file
    • !socket
    • !yamlfile - includes yaml by file path or url
  8. MAY process constructors with recursion detection (see REQUIREMENT NOTES)
  9. MAY contain cli arg mapping constructors
  10. SHOULD provide a way to extend set of constructors before configuration loaded
  11. MUST provide a way to configure logging using logging.dictConfig and values from merged configuration
  12. runtime configuration path MAY be redefined with envvar (like $ CONFIG=./some-config.yml program.py)
  13. runtime configuration path MAY be redefined with cli arg (like $ program.py --config=./some-config.yml)
  14. SHOULD enable sharing of anchors between layers
  15. SHOULD NOT allow to redefine anchors that alredy defined in previous layers
  16. MUST support filesystem path as configuration path
  17. MUST support file://, http(s):// urls as configuration path
  18. MAY support ftp:// urls as configuration path
  19. MAY support git:// urls as configuration path
  20. SHOULD support envconsul as a configuration layer
  21. SHOULD support envconsul as a mapping value (constructor)
  22. SHOULD support consul kv export as a configuration layer
  23. SHOULD support consul kv export as a mapping value (constructor)
  24. SHOULD support module as a configuration layer (for streamlined integration with existing configuration systems like django)

REQUIREMENT NOTES

  • !class, !object, and !yamlfile are considered dangerous since class or object creation may require existing configuration that is not exists during constructor call. !yamlfile can refer !class or !object inside and/or cause infinte yaml load recursion or module load recursion.
  • !file and !socket are considered dangerous since they are not serializable

IMPLEMENTATION

  • provides <module>.<config> submodule that contains resulting configuration as mapping

???

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for devconfig, version 0.3.6
Filename, size File type Python version Upload date Hashes
Filename, size devconfig-0.3.6.tar.gz (18.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page