Configuration Manager Package
Project description
ZeConfig EN - BR
ZeConfig is a Python library designed to manage application configurations, making it easier to handle sensitive data and environment-specific settings. It supports configuration files in both TOM, JSON, YAML, YML and ENV formats.
Features
- Automatic detection of configuration file location within the current directory or its subdirectories.
- Support for TOML, JSON, YAML, YML and ENV configuration files.
- Easy access to environment-specific keys and values.
Installation
pip install zeconfig
Usage
0. Creating a configuration file
At the root of the project, create a file with one of the extensions .toml, .json, .yaml, .yml or .env.
For example: config.json
1. Configuration File Format
Example config.json
{
"DATABASE_URL": "sqlite:///dev.db",
"SECRET_KEY": "dev-secret"
}
2. Initialize ZeConfig
from ze import config
3. Manage Environment Settings
Retrieve a value for a specific key in the current environment:
DATABASE_URL = config("DATABASE_URL")
print(f"Database URL: {DATABASE_URL}")
>>> OUTPUT:
sqlite:///dev.db
Error Handling
ZeConfig raises descriptive exceptions for common issues:
KeyError: Missing environment or key in the configuration file.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository.
Contact
For questions or support, please reach out to uadsonpy@gmail.com.
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
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 zeconfig-0.2.1.tar.gz.
File metadata
- Download URL: zeconfig-0.2.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1e025ada90891187dd8409d620aee7a5b58c7069fe8bd5da78b91c62821a86fd
|
|
| MD5 |
d163eff9c5914bf8f3e7929032e34828
|
|
| BLAKE2b-256 |
c4fdd7c7030f2836b42168b06b125ab07b17365086eb9c3c7a9bae97939846d9
|
File details
Details for the file zeconfig-0.2.1-py3-none-any.whl.
File metadata
- Download URL: zeconfig-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
967d977192f7d109286241cf2822033377105dd23162dadae6a1252b6a1ff5d3
|
|
| MD5 |
96bb8669abde46723238ecf3973fd7fe
|
|
| BLAKE2b-256 |
4d254adb1d89f8821eb410e8425163407bd0734125e8da83a267e22cef52dec8
|