You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP

conftier

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conftier

Multi-level configuration framework

0.2.0
Maintainers
1

conftier Banner

Build status Python Version Code style: ruff License Coverage Report

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:

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 schema

Conftier automatically merges these configurations based on priority (project > user > default).

conftier Banner

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 ConftierWith Conftier
Manual parsing of multiple config filesAutomatic loading and merging
Type errors discovered at runtimeValidation at load time
Custom code for merging configsSmart merging built-in
Documentation strugglesSchema serves as documentation
Repetitive boilerplateConsistent, reusable pattern

Installation

# Basic installation
pip install conftier

# With Pydantic support (recommended)
pip install conftier[pydantic]

Quick Example

from pydantic import BaseModel, Field
from conftier import ConfigManager

class AppConfig(BaseModel):
    app_name: str = "MyApp"
    debug: bool = False

config_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:

  • You're building a framework or library: Give your users a consistent way to configure your tool
  • Your app has both user and project settings: Like VSCode's personal vs. project-specific settings
  • You need schema validation: Ensure configuration values have the correct types and valid ranges
  • You want to reduce boilerplate: Stop writing the same configuration loading code in every project

🛡 License

License

This project is licensed under the terms of the MIT license. See LICENSE for more details.

🤝 Support

For more information, please contact: zeeland4work@gmail.com

Credits 🚀 Your next Python package needs a bleeding-edge project structure.

This project was generated with P3G

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts