Skip to main content

User Manual

https://travis-ci.org/exhuma/config_resolver.svg?branch=master
Fulll Documentation

https://config-resolver.readthedocs.org/en/latest/

Repository

https://github.com/exhuma/config_resolver

PyPI

https://pypi.python.org/pypi/config_resolver

Rationale

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.

Metadata

Release files for config-resolver 4.3.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for config-resolver 4.3.9
File Size Uploaded
config_resolver-4.3.9.tar.gz 9.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for config-resolver 4.3.9
File Interpreter ABI Platform
config_resolver-4.3.9-py2-none-any.whl Python 2 none any Details

Total release size: 21.4 kB

Release files / config_resolver-4.3.9.tar.gz

Download URL config_resolver-4.3.9.tar.gz
Size 9.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5b32ce966004c2032c22841bd0bfa2bbc27b62b1327f4b97d1d63926bead51ce
BLAKE2b-256 checksum
How to use checksums
9d1f91156d95a2c3d29ad0ec8cc04897c8d81bdf7e232db4f47b4095462fed88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

Release files / config_resolver-4.3.9-py2-none-any.whl

Download URL config_resolver-4.3.9-py2-none-any.whl
Size 11.8 kB
Tags Python 2
SHA-256 checksum
How to use checksums
3238d39699cafbfcf6b143c446d2db4fbeeacaf88883a53ce74360f33a8d1ceb
BLAKE2b-256 checksum
How to use checksums
e13894ad7e097be9d115c4f05a3dcd0dfe27b5ff0c2290bcd5f392862fdf9496
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.7.9

Release history Release notifications | RSS feed

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page