Skip to main content

A simple configuration manager

Project description

Configured

A simple configuration manager for Python that allows you to easily manage nested configurations using JSON files.

Features

  • Load and save configurations from/to a JSON file.
  • Create nested dictionaries dynamically.
  • Retrieve configuration values easily.

Installation

You can install the package via pip:

pip install configurationlib

Usage

Here is a simple example of the usage of this module:

import configurationlib

# Create an instance of the configuration manager
config = configured.Instance(file="config.json") # Choose any file name you like!

# Use save() to get access to the current configuration and set values
config.save()["dic1"] = {}  # Initialize a new dictionary
config.save()["dic1"]["afewmoredic"] = {}  # Initialize a nested dictionary
config.save()["dic1"]["afewmoredic"]["key"] = "value"  # Set a value

# Retrieve values from nested dictionaries using get()
retrieved_value = config.get()["dic1"]["afewmoredic"]["key"] # Use config.get to retrieve the value
print(retrieved_value)  # Output: value

# Save changes after modifying (optional, since save is called after every modification)
config.save()

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

configurationlib-1.0.1.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

configurationlib-1.0.1-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

Details for the file configurationlib-1.0.1.tar.gz.

File metadata

  • Download URL: configurationlib-1.0.1.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for configurationlib-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f9c53b2df02eb0f5f8423d0de3b5172f126334e0d92fa1dfd3393d706600cd56
MD5 efb91bb1401e9fa65b1cebb0878bac10
BLAKE2b-256 fc8ee8555a0a6aab214aac1e1ebf15ee433cf119fc78c9fb81c62449dc556aa4

See more details on using hashes here.

File details

Details for the file configurationlib-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for configurationlib-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 055300905f6a224b7dc0f6c2000daa4037c5ac2721ffd9638c08d8d2287512d4
MD5 924d80ba736dbb8eda70cf0d3b29b135
BLAKE2b-256 4079dae605534dac89285185d354324ed4a40e76c0cbd067c180c02224882e89

See more details on using hashes here.

Supported by

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