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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7af15abbc3f592e38e0e6a7d27f49631051c17211c08b0e8e89615fbf1f77b73 |
|
MD5 | d75eac9dd03a12d6d447484b6e7080c1 |
|
BLAKE2b-256 | bc1cdda7c4d332074ef950baa2fcbc271475911a75ada7baa0f5255d5df6140a |
Hashes for serval_config_utils-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd314dd20ef3418f10261e121f4f8163ec737a0cd4cff590e9954cc170d37739 |
|
MD5 | dac99037578dba2ddc94810f8be503d6 |
|
BLAKE2b-256 | fcca91ed51b53df49f31b7698849962a87c80f97b3c03e2986e1b0a1190d284b |