cfgtree - App Configuration made easy
Free software: MIT
Documentation: https://cfgtree.readthedocs.org/en/latest/
Description
This package provides an easy yet comprehensive way of describing, storing, parsing, modifying user configuration for a modern application.
It requires the following acknolegdments:
Application settings are stored in a hierarchical structure, they can be organized into group of settings, subgroups, and they entierely depends on the application itself.
This structure is called in cfgtree a “bare configuration”, or “configuration tree”, and is described by a “model”.
User settings may come from different inputs:
environment variables (“12-factors” approach). Example: MYAPP_VERBOSE.
command line argument. Example: --verbose
configuration storage such as file (json, yaml, ini) or configuration server. Example:
{ "verbose": true {
This allows you to define once your settings structure, and let the user of your application define the settings throught different ways. For instance, your application can read some settings through command line arguments, which is very useful for containerization of your application. It is indeed recommended by Heroku’s 12 Factor Good Practices.
Describing your configuration through a model also allows to have a configuration validator without having to maintain both a file schema (ex: JSON Schema) and the parsing logic code.
Access to settings
In your application, an xpath-like syntax allows you to reach any item of the configuration: cfg.get_cfg_value("key1.key2.key3.item").
To modify a key configuration, use cfg.set_cfg_value("key1.key2.key3.item", "new_value"). File is actually written on call of cfg.save_configuration() or automatically when autosave is set.
See the documentation for full explanation.
Similar opensource projects
Openstack’s Olso.config
Documentation
Full documentation is provided on ReadTheDocs.
Metadata
Release files for cfgtree 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| cfgtree-1.1.1.tar.gz | 21.7 kB | Without provenance | Details for cfgtree-1.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cfgtree-1.1.1-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details for cfgtree-1.1.1-py2.py3-none-any.whl |
Total release size: 45.3 kB
Release files / cfgtree-1.1.1.tar.gz
| Download URL | cfgtree-1.1.1.tar.gz |
|---|---|
| Size | 21.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
83a2b1e9156716b1f4752abf314f63fd54ce7cebae0facff950f1fb08ff53ad0
|
|
BLAKE2b-256 checksum How to use checksums |
df0377463d611a4a690888db2d44855c3e0fb4eb3dcb6884932436fcef6e21f4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / cfgtree-1.1.1-py2.py3-none-any.whl
| Download URL | cfgtree-1.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 23.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
cf3ab88d9615bbc1645ef2864242eaffeb33a8e158a5b44424bafd009fd93469
|
|
BLAKE2b-256 checksum How to use checksums |
79783b47b86e00abafeb3f1bfdb3809be4b3aaae3b688cfb691d960d30b30a8b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for cfgtree 1.1.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.