Described configuration for large, complex projects. Read the docs!
Features
Define config keys using a nicer API to colander.
Get config values as a callable before loading or directly afterwards.
Define multiple ‘confers’ to allow large codebases to be worked on independently.
Quick Usage
Firstly, define the key(s) you want to be in the config file. They can be any type colander supports, even custom types. Builtin types can be accessed more easily through the included data module.
import confing
from confing import data
confer = confing.getConfer('my_confer_name')
confer.define(data.String(name='secret_key'))
Next, load the data for the configuration.
loaded = confer.load({'secret_key': '...'})
loaded is confer.loaded
Lastly, get the key you want out of the config.
confer.loaded.secret_key
# or
confer.loaded['secret_key']
If you need to pass a configuration value to something either at module-import time or before the config is loaded, you can pass it a callable that will be the correct value once the config is loaded later. This will only work if the receiving party doesn’t attempt to resolve the value before the config is loaded.
``python confer.as_callable(‘secret_key’) ```
Install for development
$ pip install --editable .
Contributing
Anyone can help make this project better - read CONTRIBUTION to get started!
License
Apache 2.0. See the LICENSE file for more details.
Release files for confing 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| confing-0.1.4.tar.gz | 12.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| confing-0.1.4-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size: 18.5 kB
Release files / confing-0.1.4.tar.gz
| Download URL | confing-0.1.4.tar.gz |
|---|---|
| Size | 12.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
da439f35763b07b9ca0f842530ed67aa1a5a9ad2afc465091eb6124c517e41de
|
|
BLAKE2b-256 checksum How to use checksums |
d25d5771de021ba6fb14a96bdc5b030a8b8515be34d8a7449354068d7ccf308f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / confing-0.1.4-py2.py3-none-any.whl
| Download URL | confing-0.1.4-py2.py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
f104501dcf5ed03d6a085d68475f80c4790cf3ab047851872e5a969b88a310b4
|
|
BLAKE2b-256 checksum How to use checksums |
12078166a54fa71fdb5b9f7a8406c1c0734b887fb1bcd7f6b3383261e3d9ad05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |