Skip to main content

Configerus

Dynamic and abstract configuration management

An extendable plugin based configuration system, which allows abstract config primitives to be loaded from various prioritized sources. Config from higher priority source plugins takes precedence over lower priority, with some simple deep merging.

Configerus makes config easy by:

  1. having a simple construction method
  2. allowing config to be pulled from a variatey of sources, such as json/yml in file paths, or custom dicts
  3. using priorities, configerus allows config override, where some sources can override others.
  4. deep configuration retrieval is easy using "dot" (one.two.three) notation to search in config trees

Configerus offers a few tricks for complex use-cases

  1. you can apply simple validation (such as jsonschema) on retrieved config
  2. you can use a templating syntax to embed config from one source into another at the time of retrieval
  3. you can use a templating syntax to direct configeraus to replace a string file path with the contents of that file. Some files will be unmarshalled for the replacement.

Configerus makes advanced config management possible by:

  1. allowing you to define your own sources, formatters and validators and inject them at run time
  2. allowing you to extend using setuptools entrypoints for advanced functionality bootstrapping.

Usage

Configerus has a bit of steep learning curve in its approach and construction but it easy to use if it is set up correctly.

A cheap and dirty example:

If you have a folder ./config that has to config files in it:

  • settings.yaml
  • values.json
import configerus
from configerus.contrib.dict import PLUGIN_ID_SOURCE_DICT
from configerus.contrib.files import PLUGIN_ID_SOURCE_PATH

config = configerus.new_config()
# tell configerus to read files from a path
config.add_source(PLUGIN_ID_SOURCE_PATH).set_path('./config')
# add a dynamic dict to configerus, with a 90/100 priority
config.add_source(PLUGIN_ID_SOURCE_DICT, priority=90).set_data({
    'values': {
        'one': 'overriden from dict'
    }
})

# load all of the settings
settings = config.load('settings')
user_id = settings.get('user.id') # expects that settings had {user: {id: 'some value'}}

# load some overriding values
values = config.load('values')  # loads the value file, but overrides from the dict
assert values.get('one') == 'overriden from dict'

Metadata

Release files for configerus 3.0.1

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

Source distribution (sdist)

Source distribution for configerus 3.0.1
File Size Uploaded Provenance Actions
configerus-3.0.1.tar.gz 33.2 kB Without provenance Details for configerus-3.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for configerus 3.0.1
File Interpreter ABI Platform Actions
configerus-3.0.1-py3-none-any.whl Python 3 none any Details for configerus-3.0.1-py3-none-any.whl

Total release size: 77.2 kB

Release files / configerus-3.0.1.tar.gz

Download URL configerus-3.0.1.tar.gz
Size 33.2 kB
Tags Source
SHA-256 checksum
How to use checksums
25e074179e847099222d82128d398e6735f602fa8184938a0c98d5083e7fed92
BLAKE2b-256 checksum
How to use checksums
feb1314eda2ebfd59a4a8c561277e2bf4ba684cffca832ef48073ddbcc82012a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.6

Release files / configerus-3.0.1-py3-none-any.whl

Download URL configerus-3.0.1-py3-none-any.whl
Size 44.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
35b8f553f78b388ed01edaf9a5dbacc669ac7f105670d986bbab914348704986
BLAKE2b-256 checksum
How to use checksums
638c146281c957bd8afbd4c46b502fd7ab00869bd9056be411f9f60b382bc095
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.6

Security for configerus 3.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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