Skip to main content

Configuration Manager Package

Project description

ZeConfig EN - BR

Buid Tests Release

ZeConfig

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zeconfig-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

zeconfig-0.1.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file zeconfig-0.1.0.tar.gz.

File metadata

  • Download URL: zeconfig-0.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for zeconfig-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0ab98080d56885631ec9eaebd0d9f8cdcaa01f060adc9500d78b97473c925509
MD5 5aa066cd1c1484ea7a54643bce4bd12a
BLAKE2b-256 c4f59e38db998c673cbc726fcabafa542fd4bc33e4e4a4ca714b8f974cd07d83

See more details on using hashes here.

File details

Details for the file zeconfig-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: zeconfig-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for zeconfig-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3e3d7c2529b20463601495822703657b593f7e4f8b55988534349f3b8900b3e9
MD5 f7648511513e40adc56bfae4e8ac5c05
BLAKE2b-256 17b4ad5da5a9161ef9b6f781d3385637b42d55e755a17604307c3f271eaee9c3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page