A package for handling configuration files
Project description
configwizard
configwizard is a Python package for handling configuration files. It provides a Config
class that allows you to easily create, read, update, and delete configuration files in different formats such as JSON and TOML.
Changelog
Installation
You can install configwizard using pip:
pip install configwizard
Usage
Here's an example of how to use configwizard:
from configwizard import ConfigHandler
# Create a new configuration file
config = ConfigHandler.Config('config', 'json')
# Add content to the configuration file
config.update_content({'key': 'value'})
# Get the contents of the configuration file
contents = config.get_content()
print(contents) # Output: {'key': 'value'}
# Update the contents of the configuration file
config.update_content({'key2': 'value2'})
# Get the updated contents
contents = config.get_content()
print(contents) # Output: {'key': 'value', 'key2': 'value2'}
# Destroy the configuration file
config.destroy_config()
In the example above, we create a Config instance with a file name of 'config' and a file type of 'json'. We then add content to the configuration file using the add_content method and retrieve the contents using the get_content method. We update the contents with new values using the update_content method and finally destroy the configuration file with the destroy_config method.
Supported File Types
configwizard supports the following file types for configuration files:
- JSON (.json)
- TOML (.toml)
When creating a Config instance, make sure to provide the appropriate file type.
License
This project is licensed under the MIT License. See the LICENSE file for more information.
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
File details
Details for the file configwizard-1.0.5.tar.gz
.
File metadata
- Download URL: configwizard-1.0.5.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6849f1bf33ffd9d04f8aad13a4813972471779b4276e574226c71bfa8aa1d74 |
|
MD5 | 0720c0bbbf7e78b2688510f3e3c19eaa |
|
BLAKE2b-256 | da0488a9c84db42e6f9f0bcda2f7e9961882f8708884c10ebd975d24c17232fd |
File details
Details for the file configwizard-1.0.5-py3-none-any.whl
.
File metadata
- Download URL: configwizard-1.0.5-py3-none-any.whl
- Upload date:
- Size: 7.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cc5a9ae5c5164d797e2f8fa6d25d53ea214030ad2f5cf616d5d9e6ff002bcd76 |
|
MD5 | a0a596846482720241c3c958ecb1dfa9 |
|
BLAKE2b-256 | fd4fc1ec867732db9fddc145b184f07d55b30cf5020894b3425123fa5092c634 |