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 configured
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file configurationlib-1.0.0.tar.gz.
File metadata
- Download URL: configurationlib-1.0.0.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6b46ad21d1a5da45b3af89bd76345215a3642f5e655c1e5482138c3798e28b9
|
|
| MD5 |
e289f17f102b0ed6f2b76a61aa29bd53
|
|
| BLAKE2b-256 |
f00af5b6a266e6a8d11a910f882804985b6446e507dfa6a53bc8b946ee2a570b
|
File details
Details for the file configurationlib-1.0.0-py3-none-any.whl.
File metadata
- Download URL: configurationlib-1.0.0-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
211bd731ee2f6a29e56e28b09a7102fb267bda75874fd0e48c1a8f3b53ca45c8
|
|
| MD5 |
b0ab481edafa1075161d8f4329b8ae73
|
|
| BLAKE2b-256 |
143309ca80b9e24b3445b6847593a1569630fe20cc765bbdcf1670429ba5f0a4
|