pyconfigurationmanager
The pyconfigurationmanager package provides a set of utilities for managing configuration settings in Python applications. It includes classes and functions for loading configuration data from files, auditing configuration changes, and ensuring secure access to configuration files.
Installation
Configuration Manager can be installed using pip:
pip install pyconfigurationmanager
Usage
from pyconfigurationmanager import ConfigurationManager
# Load the configuration file
ConfigurationManager.load_config(file_path='config.json')
# Retrieve a string value
string_value = ConfigurationManager.get_config_value('sample_string')
print(string_value) # Output: 'string_of_sample'
# Retrieve an integer value
integer_value = ConfigurationManager.get_config_value('sample_integer')
print(integer_value) # Output: 100
# Retrieve a dictionary value
dict_value = ConfigurationManager.get_config_value('sample_others')
print(dict_value)
# Output:
# {'sample_boolean': True, 'sample_list': ['list_1', 'list_2']}
# Retrieve a boolean value
boolean_value = ConfigurationManager.get_config_value('sample_others.sample_boolean')
print(boolean_value) # Output: True
# Retrieve a list value
list_value = ConfigurationManager.get_config_value('sample_others.sample_list')
print(list_value) # Output: ['list_1', 'list_2']
Documentation
pyconfigurationmanager
ConfigurationManager
The ConfigurationManager class is the heart of the package, offering a suite of functionalities for managing configuration settings.
Methods
load_config(file_path: Optional[str] = 'config.json', secure: Optional[bool] = True, audit: Optional[bool] = False, audit_file_path: Optional[str] = 'audit.log'): Loads configuration settings from a file into memory, with options to enable secure mode and auditing. By default, secure mode is enabled, ensuring that the configuration file has only readable permissions for the user. If auditing is enabled, all configuration accesses are logged for future audit purposes.get_config_value(key: Optional[str] = None): Retrieves the value of a specific configuration setting or the entire configuration if no key is provided. Hierarchical keys can be accessed by separating them with '.'.
ConfigurationManagerError
This error class is employed to signal any issues or errors encountered during the execution of ConfigurationManager methods.
Methods
__init__(message: Optional[str])- Initialize a ConfigurationManagerError
Metadata
Release files for pyconfigurationmanager 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyconfigurationmanager-0.1.2-py3-none-any.whl | Python 3 | none | any | Details for pyconfigurationmanager-0.1.2-py3-none-any.whl |
Release files / pyconfigurationmanager-0.1.2-py3-none-any.whl
| Download URL | pyconfigurationmanager-0.1.2-py3-none-any.whl |
|---|---|
| Size | 5.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a3a435db27b1d90a0b24da7ee06aeeffaea282109b8a764fd1565a5a3d1e1c0d
|
|
BLAKE2b-256 checksum How to use checksums |
6f8daaa426b9a4130951fe29545fa8de1e9d6074c7f5a11fb77fc90158662e6f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.14
|
Security for pyconfigurationmanager 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.