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.12.tar.gz
(5.5 kB
view hashes)
Built Distribution
Close
Hashes for WrapConfig-0.1.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5ed476f944bfe24758fbccdb5e4174f7c9ad83464a29975ba8540e60be5a21d |
|
MD5 | a1e6f18d00d15d88143269df8436c9d1 |
|
BLAKE2b-256 | bea245c53aea2fc96b667f7c967f6675a88e089a6118955a85d9d2917dc0a470 |