Skip to main content

SerVal-Config-Utils automatically parse configurations from multiple sources into a single python dictionary.

Project description

SerVal-Config-Utils

License: MIT test

Bugs Code Smells Coverage Duplicated Lines (%) Vulnerabilities

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

serval-config-utils-0.1.4.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

serval_config_utils-0.1.4-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page