https://github.com/undertone0809/conftier
A powerful Python multi-tier configuration management framework that simplifies the definition, access, and synchronization of layered configurations in Python application and framework.
https://github.com/undertone0809/conftier
dataclass multi-level-config pydantic python python-config python-configuration
Last synced: 12 days ago
JSON representation
A powerful Python multi-tier configuration management framework that simplifies the definition, access, and synchronization of layered configurations in Python application and framework.
- Host: GitHub
- URL: https://github.com/undertone0809/conftier
- Owner: Undertone0809
- License: mit
- Created: 2025-03-29T12:06:38.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2025-05-16T10:37:26.000Z (12 days ago)
- Last Synced: 2025-05-16T11:19:41.661Z (12 days ago)
- Topics: dataclass, multi-level-config, pydantic, python, python-config, python-configuration
- Language: Python
- Homepage: http://conftier.zeeland.top/
- Size: 879 KB
- Stars: 20
- Watchers: 1
- Forks: 2
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
README
![]()
[](https://github.com/Undertone0809/conftier/actions?query=workflow%3Abuild)
[](https://pypi.org/project/conftier/)
[](https://github.com/astral-sh/ruff)
[](https://github.com/Undertone0809/conftier/blob/main/LICENSE)
# Conftier
A powerful multi-tier configuration management framework that simplifies the definition, access, and synchronization of layered configurations in Python applications.
Think of VSCode's configuration system: you have user settings that apply globally and workspace settings that override them for specific projects. Conftier brings this same intuitive model to your Python frameworks and applications.
## Documentation
For comprehensive guides, examples, and API reference, visit our documentation:
- [Introduction](https://conftier.zeeland.top/)
- [Quick Start Guide](https://conftier.zeeland.top/guide/quick-start.html)
- [Contributing](https://conftier.zeeland.top/other/contributing.html)## Overview
Conftier helps you manage configurations across multiple levels:
- **User-level settings**: Global preferences that apply across all projects (~/.zeeland/{config_name}/config.yaml)
- **Project-level settings**: Local configurations specific to a project (./.{config_name}/config.yaml)
- **Default values**: Fallback values defined in your configuration schemaConftier automatically merges these configurations based on priority (project > user > default).
![]()
## Key Features
- **Multi-level Configuration Management**: Like VSCode's user/workspace settings pattern
- **Flexible Schema Definition**: Use Pydantic models or dataclasses to define and validate configurations
- **Type Safety**: No more string/int confusion or missing required fields
- **Smart Merging**: Only override what's specified, preserving other values
- **CLI Integration**: Built-in command-line tools for configuration management
- **IDE Autocompletion**: Full type hints for a great developer experience## Why Conftier?
| Without Conftier | With Conftier |
|------------------|---------------|
| Manual parsing of multiple config files | Automatic loading and merging |
| Type errors discovered at runtime | Validation at load time |
| Custom code for merging configs | Smart merging built-in |
| Documentation struggles | Schema serves as documentation |
| Repetitive boilerplate | Consistent, reusable pattern |## Installation
```bash
# Basic installation
pip install conftier# With Pydantic support (recommended)
pip install conftier[pydantic]
```## Quick Example
```python
from pydantic import BaseModel, Field
from conftier import ConfigManagerclass AppConfig(BaseModel):
app_name: str = "MyApp"
debug: bool = Falseconfig_manager = ConfigManager(
config_name="myapp",
config_schema=AppConfig,
auto_create=True
)# Load the merged configuration
config: AppConfig = config_manager.load()
```## When to Use Conftier
Conftier shines when:
1. **You're building a framework or library**: Give your users a consistent way to configure your tool
2. **Your app has both user and project settings**: Like VSCode's personal vs. project-specific settings
3. **You need schema validation**: Ensure configuration values have the correct types and valid ranges
4. **You want to reduce boilerplate**: Stop writing the same configuration loading code in every project## 🛡 License
[](https://github.com/Undertone0809/conftier/blob/main/LICENSE)
This project is licensed under the terms of the `MIT` license.
See [LICENSE](https://github.com/Undertone0809/conftier/blob/main/LICENSE) for more details.## 🤝 Support
For more information, please
contact: [[email protected]](mailto:[email protected])## Credits [](https://github.com/Undertone0809/python-package-template)
This project was generated with [P3G](https://github.com/Undertone0809/P3G)