Skip to main content

A simple configuration manager

Project description

Configurationlib

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 = configurationlib.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.2.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.2-py3-none-any.whl (2.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: configurationlib-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 572d81a60c39777dac248728c0035ef751543dd7b7602fe14cf4a7700239cd62
MD5 75f8e33237cdef333be0f0a756112dfa
BLAKE2b-256 a4a932221ab117a450c3b8ae92b246bf9dc3338c7782ba763af1013ecba3a781

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for configurationlib-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 9b3722e27e42372c443565ec7defe1383a5855d93f31ea3d4927ba22cccf706b
MD5 419b70414a48cdfb7be0f7207be3ad03
BLAKE2b-256 8897e6e07647f70e523bd37e31e536e9b1cd0c5770c23fb9fa9285799127b64a

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