Configuration Enhanced & Easy ☕️ - A Hydra-like configuration parser helper package
Project description
☕️ Overview
confee makes configuration management simple, type-safe, and intuitive. Combine config files, Pydantic validation, environment variables, and CLI arguments seamlessly.
✨ Features
- 🎯 Type-Safe — Pydantic V2 validation & IDE autocomplete
- 📋 Multi-Format — YAML, JSON, TOML auto-detection
- 🔄 Override System — CLI args & environment variables with priority control
- 🔐 Secret Masking —
SecretField()for sensitive data - 🧊 Immutability — Runtime config freezing
- 📐 Extensible — Plugin system, JSON Schema, async loading
📦 Installation
pip install confee
🚀 Quick Start
from confee import ConfigBase, SecretField
class AppConfig(ConfigBase):
name: str
debug: bool = False
workers: int = 4
api_key: str = SecretField(default="")
config = AppConfig.load(config_file="config.yaml")
print(config.name) # Type-safe access
# config.yaml
name: my-app
workers: 8
api_key: secret123
# Override via CLI
python app.py name=production debug=true
# Override via environment
export CONFEE_NAME=production
💡 Common Patterns
Nested Configuration
class DatabaseConfig(ConfigBase):
host: str = "localhost"
port: int = 5432
class AppConfig(ConfigBase):
database: DatabaseConfig
# Override: python app.py database.host=prod.db
File References & Secret Masking
api_key: "@file:secrets/api_key.txt"
config.to_safe_dict() # {'api_key': '***MASKED***', ...}
Config Freezing & Custom Prefix
config = AppConfig.load(
config_file="config.yaml",
env_prefix="MYAPP_",
strict=False
)
config.freeze() # Immutable
📚 Documentation
For advanced features, see ADVANCED.md:
- Config Freezing & Immutability
- JSON Schema Generation
- Remote Config Loading (HTTP/HTTPS)
- Plugin System (Custom Loaders, Validators, Hooks)
- Config Diff & Merge
- Integration Examples (FastAPI, Django, Kubernetes, AWS Lambda)
📄 License
MIT License © 2025 — See LICENSE for details.
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 confee-0.3.2.tar.gz.
File metadata
- Download URL: confee-0.3.2.tar.gz
- Upload date:
- Size: 751.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
281d917ad974b9cf98efa286444752a1ee7e41a234bbc259a92de086577a71f6
|
|
| MD5 |
36b098690c5bc19993415f969f8e7e62
|
|
| BLAKE2b-256 |
64ff1e99050d3c8914c55b01f34e7facab40cbf1c5f95544e3052a7b78b3f1f4
|
File details
Details for the file confee-0.3.2-py3-none-any.whl.
File metadata
- Download URL: confee-0.3.2-py3-none-any.whl
- Upload date:
- Size: 35.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7bc461e4358127e5b001245e71f7e6cf4ada069639769a436750d1da54a3601a
|
|
| MD5 |
f125680e0825ec6360b13f5a3462334b
|
|
| BLAKE2b-256 |
65cd086cd7395667b92119fe7468035e400deba5f5f38c48724ee0019a1378c1
|