Wraper to manage configurations
Project description
WrapConfig
A Python package for managing and persisting configurations with flexibility and ease.
Table of Contents
Features
- Flexible Configuration: Easily manage configurations with support for nested keys and subkeys.
- Persistence: Persist configurations to various data sources, including in-memory, JSON, and YAML files.
- Extensible: Easily extend the package with custom data source support.
Installation
You can install the package via pip:
pip install WrapConfig
Usage
from wrapconfig import JSONWrapConfig
# Create a JSONWrapConfig instance
config = JSONWrapConfig('config.json')
# Set a configuration value
config.set('section', 'key', value = 'value')
# the value key is not necessary,
config.set('section', 'key', 'value') # results in the same, but is less readable
config.set('section') # will fail, since there is only a key no value
# Get a configuration value
value = config.get('section', 'key')
# Persist changes
config.save()
Configuration
You can configure the package in various ways, including:
- Setting default save behavior.
- Choosing different data sources such as JSON and YAML.
Examples
For more usage examples, please refer to the examples directory. (TODO)
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
WrapConfig-0.1.14.tar.gz
(5.4 kB
view hashes)
Built Distribution
Close
Hashes for WrapConfig-0.1.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2e99d5bb220b901b4897b1f7ecda62b9922a068869ba8841a38e9d784f2a650 |
|
MD5 | 1a045ee29d4002bf6e604d7aeca4f227 |
|
BLAKE2b-256 | e7219218297b7d4e5cb560e28d5a9ec425d617e4d3e7bbe30e8d230d9c1269cd |