Skip to main content

Minimal Application Configuration

Project description

MinCfg

Tests/Pylint/Mypy

the Minimum Configuration Handling System

There are many configuration management/definition systems. This one is mine. This is an overview. There are also more formal docs.

A set of simple tools to build a configuration system with

The first set are 'sources':

  • DictSource, which takes values from a python dict and is useful for defaults
  • SubsetSource, which returns a subset of another source, to help with merge precedence
  • OSEnvironSource, which parses config values from os.environ into hierarchical dictionaries
  • YamlFileSource, which parses a yaml file into hierarchical dictionaires (pip install mincfg[yaml] for support)
  • INIFileSource, which understands INI files (based on configobj) (pip install mincfg[ini] for support)
  • DotEnvSouce, which understands .env files (based on python-dotenv) (pip install mincfg[env] for support)

The second tool is:

  • MergedConfiguration: which merges multiple configuration sources into a coherent whole

Yes, much more could be done:

  • required keys
  • value validation
  • default parsers
  • default default values (that .get() without a default would default to)
  • more file types (json, ... xml?)
  • sphinx/rtd docs

... PRs accepted!

Much inspiration - and the .get() signature - is taken from everett, but the implementation is all mine.

To install

pip install mincfg

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

mincfg-0.9.tar.gz (45.2 kB view hashes)

Uploaded Source

Built Distribution

mincfg-0.9-py3-none-any.whl (33.8 kB view hashes)

Uploaded Python 3

Supported by

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