Skip to main content

A small package to automatically find a configuration file.

Project description

A system to resolve config files for python projects
====================================================

A very simple and small utility to provide a way to search for configuration
files. For now it is only tested on posix systems, but it should also work on
Windows.

For posix systems it will search for config files in the following order:

- ``/etc/<group_name>/<app_name>/<conf_name>``
- ``~/.<group_name>/<app_name>/<conf_name>``
- The current active working directory (of the running process)
- [optional] Any paths specified in the environment variable ``<APP_NAME>_PATH``
- A file named in the environment variable ``<APP_NAME>_CONFIG``

The complete search path can be controlled by setting the environment variable
``<APP_NAME>_PATH``, separating the different paths by either ``:`` (posix) or
``;`` (windows). If the folder in the ``<APP_NAME>_PATH`` begins with a ``+``,
then the paths in that variable will be *appended* to the default search path
instead of replacing the path.

The last file found will always take precedence by extending/overwriting
previously loaded files. As an example you can have system globals in
``/etc``, and then on a per-user basis override values. Existing values are
kept, so config files further down the lookup chain do not contain all values.

Even further down the lookup chain you can use the working-directory or
``<APP_NAME>_CONFIG`` to override values on a per-application instance basis.


Changelog
=========

.. include:: CHANGES

Project details


Download files

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

Source Distribution

config_resolver-3.2.1.tar.gz (4.5 kB view details)

Uploaded Source

File details

Details for the file config_resolver-3.2.1.tar.gz.

File metadata

File hashes

Hashes for config_resolver-3.2.1.tar.gz
Algorithm Hash digest
SHA256 5bf894e52dc327c8ad306d07a58a84ea3a9f4516ab404ae84116963707cfc715
MD5 fe949ff60dff96fb2290ebd7cfdc05d8
BLAKE2b-256 6634d8da8a72bbf7f09605efa52e12d658f161515bd58797e719bd736f364601

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page