Skip to main content
Documentation Status https://github.com/MacHu-GWU/configcraft-project/actions/workflows/main.yml/badge.svg https://codecov.io/gh/MacHu-GWU/configcraft-project/branch/main/graph/badge.svg https://img.shields.io/pypi/v/configcraft.svg https://img.shields.io/pypi/l/configcraft.svg https://img.shields.io/pypi/pyversions/configcraft.svg https://img.shields.io/badge/✍️_Release_History!--None.svg?style=social&logo=github https://img.shields.io/badge/⭐_Star_me_on_GitHub!--None.svg?style=social&logo=github
https://img.shields.io/badge/Link-API-blue.svg https://img.shields.io/badge/Link-Install-blue.svg https://img.shields.io/badge/Link-GitHub-blue.svg https://img.shields.io/badge/Link-Submit_Issue-blue.svg https://img.shields.io/badge/Link-Request_Feature-blue.svg https://img.shields.io/badge/Link-Download-blue.svg

Welcome to configcraft Documentation

https://configcraft.readthedocs.io/en/latest/_static/configcraft-logo.png

A Python library for DRY (Do not repeat yourself) configuration management with inheritance patterns and secure configuration merging.

📚 Full documentation is available at HERE

Key Features:

  • 🔄 Configuration Inheritance: Use _defaults sections to eliminate duplication across environments

  • 🔒 Secure Config Merging: Safely combine non-sensitive config with secrets without exposing credentials

  • 🎯 JSON Path Patterns: Apply defaults with flexible *.field and env.field patterns

  • 📋 List Merging: Intelligently merge lists by position to maintain data relationships

  • 🛡️ Type Safety: Structure-aware merging with validation and clear error messages

Quick Example

Configuration Inheritance:

from configcraft.api import apply_inheritance

config = {
    "_defaults": {
        "*.port": 8080,
        "*.timeout": 30
    },
    "dev": {
        "host": "localhost"
    },
    "prod": {
        "host": "api.company.com",
        "port": 443
    }
}

apply_inheritance(config)
# Result:
# {
#     "dev": {
#         "host": "localhost",
#         "port": 8080,
#         "timeout": 30
#     },
#     "prod": {
#         "host": "api.company.com",
#         "port": 443,
#         "timeout": 30
#     }
# }

Secure Configuration Merging:

from configcraft.api import deep_merge

# config.json (safe to commit)
base_config = {
    "database": {
        "host": "prod-db.com",
        "port": 5432
    }
}

# secrets.json (never commit)
secrets = {
    "database": {
        "password": "secret123"
    }
}

final_config = deep_merge(base_config, secrets)
# Result:
# {
#     "database": {
#         "host": "prod-db.com",
#         "port": 5432,
#         "password": "secret123"
#     }
# }

Install

configcraft is released on PyPI, so all you need is to:

$ pip install configcraft

To upgrade to latest version:

$ pip install --upgrade configcraft

Metadata

Release files for configcraft 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for configcraft 0.1.2
File Size Uploaded
configcraft-0.1.2.tar.gz 13.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for configcraft 0.1.2
File Interpreter ABI Platform
configcraft-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 28.3 kB

Release files / configcraft-0.1.2.tar.gz

Download URL configcraft-0.1.2.tar.gz
Size 13.9 kB
Tags Source
SHA-256 checksum
How to use checksums
619e86c3b3efed176a576a33f8eff16c27dfe265831d52dc4c2b1d6e834e4f21
BLAKE2b-256 checksum
How to use checksums
5276b26843e274c44f75073b1385a99c59cf48b442de835cf55684f80bfba8e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.8

Release files / configcraft-0.1.2-py3-none-any.whl

Download URL configcraft-0.1.2-py3-none-any.whl
Size 14.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bd5664db080476b9da581147d79f9dc2dc079386a843d0b08267ee46adf2487f
BLAKE2b-256 checksum
How to use checksums
f7542e4f76297738c8fef64f388eb3819f8ec42b54b9eef486d87d4e4646bb02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.8

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page