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.1.0.tar.gz (3.1 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.1.0-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for configurationlib-1.1.0.tar.gz
Algorithm Hash digest
SHA256 32343ef3d375cc20c2cf2dc2819d961677633805f70c14b6ab4323ac2de7a996
MD5 22e3480ff2c0ded99356be44bf791d80
BLAKE2b-256 6b8c93c8529803f103e0ee5a1f248edd93fff2bbf147b2c0e1677c4d819f42ba

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for configurationlib-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b838f58d5d23ccbfc1a7e0e6fa5c9f832412e41f74a68e38e7f2405ca547dda5
MD5 fede26f8654d3ba6922082873b9b8fd1
BLAKE2b-256 ce7523e89e8e5d740ca71ed81536646436542ae6213a225f7a35f0fbf4a7c2e6

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