No description or website provided.
Python Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
doc Version bumped to 4.2.2 Jan 2, 2014
testdata Optional support for version checking. Oct 26, 2013
.gitignore Added compiled docs to gitignore. Nov 11, 2013
CHANGES Changelog updated. Nov 30, 2013
README.rst Documentation updated. Nov 11, 2013
README.txt Using a .rst file for github formatting. Aug 31, 2012 Inheritance changed. Removes Py3 deprecation. Jan 2, 2014 Added TROVE classiiers. Oct 28, 2013 Avoiding PrefixFilter to be added more than once. Dec 8, 2013
workwork.bash Cleaned up the development environment. Oct 26, 2013


User Manual

Fulll Documentation


Many of the larger frameworks (not only web frameworks) offer their own configuration management. But it looks different everywhere. Both in code and in usage later on. Additionally, the operating system usually has some default, predictable place to look for configuration values. On Linux, this is /etc and the XDG Base Dir Spec.

The code for finding these config files is always the same. But finding config files can be more interesting than that:

  • If config files contain passwords, the application should issue appropriate warnings if it encounters an insecure file and refuse to load it.
  • The expected structure in the config file can be versioned (think: schema). If an application is upgraded and expects new values to exist in an old version file, it should notify the user.
  • It should be possible to override the configuration per installed instance, even per execution.

config_resolver tackles all these challenges in a simple-to-use drop-in module. The module uses no additional external modules (no additional dependencies, pure Python) so it can be used in any application without adding unnecessary bloat.

One last thing that config_resolver provides, is a better handling of default values than instances of SafeConfigParser of the standard library. The stdlib config parser can only specify defaults for options without associating them to a section! This means that you cannot have two options with the same name in multiple sections with different default values. config_resolver handles default values at the time you call .get(), which makes it independent of the section.