Skip to main content

Utils for managing configurations

Project description

Info:

Python package to manage configuration dictionaries.

Author:

Servicio de Informática y Banco de Datos <sibd@cantabria.es>

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


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.3.tar.gz (18.7 kB view details)

Uploaded Source

File details

Details for the file beautifuldict-0.1.3.tar.gz.

File metadata

  • Download URL: beautifuldict-0.1.3.tar.gz
  • Upload date:
  • Size: 18.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.2

File hashes

Hashes for beautifuldict-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3d641dc7f65baccaea59e6c30f38390fb3b0cbbe8ff83ae3b1afe5344a7d2b28
MD5 a6556a50387725b2db2f5b61e71e36cd
BLAKE2b-256 66a27dd0823d2e237341c9255cbd4ee7a8cdd1245789c93bc5f923233453ad6d

See more details on using hashes here.

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