Utils for managing configurations
Project description
- Info:
Python package to manage configuration dictionaries.
Features
Simple wrapper around python dictionaries
Access to nested keys with dot notation: config.deeply.nested.key or as dictionary keys: config['deeply']['nested']['key']
Allows add dictionaries, remove keys or modify values by overriding dictionary methods
Installation
pip install beautifuldict
Quick Example
A Baseconfig object stores the configuration parameters as a parameter tree. It gives access to parameters in two ways: as dictionary keys or as attributes of the object.
>>> from beautifuldict.baseconfig import Baseconfig
>>> CONFIG_DICT = {
>>> 'example1': 'hello world',
>>> 'example2': {
>>> 'key1': 1,
>>> 'key2': 2}
>>> }
>>> config = Baseconfig(CONFIG_DICT)
>>> config.example1 # returns 'hello world'
>>> config['example1'] # returns 'hello world'
>>> config.example2.key1 # returns 1
>>> config['example2']['key1'] # returns 1
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
beautifuldict-0.1.1.tar.gz
(16.5 kB
view hashes)
Built Distribution
Close
Hashes for beautifuldict-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 617b79c27af3e349003eb260b3d726a992e7359872a56e35ae02fda0ff821ca0 |
|
MD5 | 7a14756f4818b4332d3483610b8e100a |
|
BLAKE2b-256 | bffdfcc1aa74d2c3ff18fa97e66f463329fc4ba82a28b7a8c90b63ba4aff3ed7 |