SerVal-Config-Utils automatically parse configurations from multiple sources into a single python dictionary.
Project description
SerVal-Config-Utils
Description
SerVal-Config-Utils automatically parse configurations from multiple sources into a single python dictionary.
Installation
Dependencies
serval-config-utils requires:
- PyYAML (^6.0)
- mergedeep (^1.3.4)
User installation
The easiest way to install serval-config-parser is using pip
pip install -U serval-config-utils
Usage
In the python main file, use:
import configutils
config = configutils.get_config()
Call the main file with parameters
python main.py -c ./path/to/config.yaml \
-c ./path/to/config.json \
-p my.nested.parameter=value \
-j {"json_formatted":{"nested_parameter":"value"}} \
Access the merged config in the config
dictionary.
Example
This simple examples merge the config from examples/basic_config.yaml
and examples/basic_config.json
and prints it in the standard output.
python examples/basic_example.py -c examples/basic_config.yaml -c examples/basic_config.json
Development
We welcome new contributors of all experience levels. Use pre-commit to ensure your code follows standards.
Source code
git clone https://github.com/serval-uni-lu/python-config-parser
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
Built Distribution
Hashes for serval-config-utils-0.1.3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2c140855b11e619bb9aa9a65682d2ed3a9dc8d1109acaa02237241e6c7c0296 |
|
MD5 | a51ef52decb7168ff6153d3871d7df7e |
|
BLAKE2b-256 | da20f163bca6e5f7dda95425f2c5f2f02294dc2cb95b03fe3c4dfcf3ae23fda0 |
Hashes for serval_config_utils-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f2d933d97f0f2fad76b8d4a0d52d6508c20b1dc1d0d91e36af48b20c2640f33 |
|
MD5 | 2f861f2d683f6d3e5b314da5484348ce |
|
BLAKE2b-256 | d40b2a6d1406ce5046f8b0e3cc022693469d7d9837c704de0c1f57187f3a6646 |