hierarchical configuration
Project description
ConfigChain
The key feature of ConfigChain, is the ability to dynamically create a hierarchical configuration by composition and override it through config files and the command line.
- Installation :
pip install configchain --upgrade
Usage
from configchain import configchain
cs = configchain("./tests/asset/a.yaml", "./tests/asset/b.yaml", name="app-${app}", profile="profile")
print(cs)
... ConfigSet([('app-hello',
Config([('*',
ConfigSnippet([('by', 'tao'),
('env', ['ENV=${profile}', 'PROCESSES=32']),
('at', 'aws'),
('app', 'hello')])),
('test',
ConfigSnippet([('by', 'tao'),
('env',
['ENV=${profile}',
'PROCESSES=32',
'PROCESSES=1']),
('at', 'docker'),
('profile', 'test'),
('app', 'hello')]))])),
('*',
Config([('*',
ConfigSnippet([('by', 'luo'),
('env', ['ENV=${profile}']),
('at', 'aws')])),
('test',
ConfigSnippet([('by', 'luo'),
('env', ['ENV=${profile}']),
('at', 'docker'),
('profile', 'test')]))]))])
a.yaml
by: luo
env:
- ENV=${profile}
at: aws
---
profile: test
at: docker
b.yaml
app: hello
by: tao
env:
- PROCESSES=32
---
profile: test
env:
- PROCESSES=1
License
ConfigChain is licensed under MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
configchain-0.3.12.tar.gz
(7.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file configchain-0.3.12.tar.gz.
File metadata
- Download URL: configchain-0.3.12.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
efb6b15d0a588d94fcbad56fa30720425f71cb9db597818a7e278e1b92dfd13a
|
|
| MD5 |
7d8b532570564d359a479171f56e7993
|
|
| BLAKE2b-256 |
c42ddff90d514f1dcbdbb21f7844a443c0422aa5c9b8bce62c5014e37063b546
|
File details
Details for the file configchain-0.3.12-py3-none-any.whl.
File metadata
- Download URL: configchain-0.3.12-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.8.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b6e688442a06bd7c03cb4634c8dac2aa5d7593ed65ece97196877fbbed21207
|
|
| MD5 |
92c172ff8136d030f42dcbd1b45691b1
|
|
| BLAKE2b-256 |
c392962a8b05dea47650f375880d08fcf77eb1f84beb44b7e30ca3fcf1913dcd
|