Config Setup for Python - create and save settings or configurations
Project description
Configuration Creator for Python
A Python library for managing configurations. Supports saving and loading configurations in various formats, such as JSON, YAML, XML, INI, and CFG.
Installation
To install the library, you can use pip:
pip install ConfigSetup
Usage
To use the ConfigSetup library in your Python code, you can import it and create an instance of the ConfigSetup
class:
from config_setup import ConfigSetup
config = ConfigSetup()
Setting and Getting Values
To set a value in the configuration, you can use the set
method:
config.set('name', 'John')
To get a value from the configuration, you can use the get
method:
name = config.get('name')
Saving and Loading Configurations
To save the configuration to a file, you can use the save
method and specify the file format:
config.save('config', 'json')
To load a configuration from a file, you can use the load
method and specify the file path:
config.load('config.json')
Validating Configurations
To validate a configuration data string against a specific format, you can use the validate
method and specify the format:
data = '{"name": "John", "age": 30}'
valid = config.validate(data, 'json')
Clearing the Configuration
To clear the configuration, you can use the clear
method:
config.clear()
License
This library is released under the MIT License.
Contributing
Contributions are always welcome! If you'd like to contribute to this library, please follow these steps:
- Fork the project on GitHub.
- Clone your forked repository to your local machine.
- Create a new branch for your changes.
- Make your changes and commit them, making sure to write clear commit messages.
- Push your branch to your forked repository.
- Submit a pull request to the main project repository, explaining your changes and why they should be merged.
Before submitting a pull request, please make sure to run the tests by executing the following command from the project's root directory:
python -m unittest discover
If any tests fail, please investigate and fix the issue before submitting your pull request.
Thank you for your interest in contributing to this project!
Project details
Release history Release notifications | RSS feed
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 config_setup-0.7.8.tar.gz
.
File metadata
- Download URL: config_setup-0.7.8.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d701b32f9d51715303254e0551809699affafb6cf27baf9c0acf5a26b33325a |
|
MD5 | 966c5e52c923a5ecf9aad97880e676b5 |
|
BLAKE2b-256 | d2ca6e51873d4db7348f4e5c7ae487292567973e19f1748bb279f7ac72c1e024 |
File details
Details for the file config_setup-0.7.8-py2.py3-none-any.whl
.
File metadata
- Download URL: config_setup-0.7.8-py2.py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d6b71bc07a35f496c64e2e6c064aa5783880290db7f12285d182acf6d9ff787 |
|
MD5 | 68da059e891992daffa2c42259d21c00 |
|
BLAKE2b-256 | f17f9e70e5dd8c7a2d0f7899f8c919b3d025e4027c27b077c65f45304e987199 |