Cascading Configuration Manager - deep-merge configuration files across multiple directories
Project description
CasConf
Cascading Configuration Manager
CasConf is a flexible configuration management tool that deep-merges configuration files across multiple directories following a cascading pattern.
Overview
CasConf scans a configurable list of directories for matching configuration files and intelligently deep-merges them based on discovery order. The result is a single, unified configuration that respects the cascade hierarchy you define.
Key Features
- Deep Merging: Recursively merges nested configuration structures
- Format Agnostic: Supports JSON, YAML, TOML, and INI formats
- Configurable Discovery: Define your own directory scan order
Use Cases
- Application configuration across development, staging, and production environments
- User-specific configuration overrides (system → user → project)
- Plugin or module configuration aggregation
- Multi-tenant configuration management
- Dotfile management and system configuration
Documentation
- USAGE.md - Getting started guide with examples
- ARCHITECTURE.md - System design and component overview
- DESIGN.md - Design decisions and rationale
- CONTRIBUTING.md - Contribution guidelines
- API.md - Library API reference
Installation
# From PyPI (when published)
pip install casconf
# From source
pip install git+https://github.com/ConsoleCatzirl/casconf.git@main
Basic Usage
Command-Line Interface
# Merge configs and output to stdout (default)
casconf --discovery-config ./casconf.yaml
# Output to a file
casconf --discovery-config ./casconf.yaml --output ./merged.json
# Specify output format
casconf --discovery-config ./casconf.yaml --format yaml
# Configure with environment variables
export CASCONF_DISCOVERY=./casconf.yaml
export CASCONF_OUTPUT=./merged.json
export CASCONF_FORMAT=json
casconf
# Pipe to other tools
casconf | jq '.database'
Library Usage
from casconf import merge_configs
# Merge and return configuration data
config_data = merge_configs(discovery_config='./casconf.yaml')
# Merge and write to file in one call
merge_configs(
discovery_config='./casconf.yaml',
output='./output/config.json',
output_format='json'
)
from casconf import merge_configs, DiscoveryConfig
# Build a DiscoveryConfig programmatically (no file required)
discovery = DiscoveryConfig(
directories=[
'/etc/myapp/defaults',
'/etc/myapp/$ENVIRONMENT', # expanded at runtime, e.g. production
'~/.config/myapp',
],
patterns=['config.json', 'config.yaml'],
merge_strategy='deep',
)
config = merge_configs(discovery_config=discovery)
Discovery Configuration
CasConf uses a discovery configuration file to determine where to search for configuration files:
# casconf.yaml
directories:
- /etc/myapp/defaults # site-wide defaults
- /etc/myapp/$ENVIRONMENT # environment-specific overrides, e.g. production, staging
- /etc/myapp/$HOSTNAME # host-specific overrides, e.g. web-01.example.com
- ~/.config/myapp # user overrides (highest priority)
patterns:
- "config.json"
- "config.yaml"
- "*.conf.json"
merge_strategy: deep # or 'shallow'
Directory paths support ~ expansion and $VAR / ${VAR} environment variable expansion. Missing directories are skipped with a warning — no error is raised. See USAGE.md for a full walkthrough.
License
This project is dual-licensed:
- MIT License: When used as a standalone executable (CLI tool)
- GNU General Public License v3.0 (GPL-3.0): When imported or linked as a library
See LICENSE for full details.
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
This project follows PEP 8 style guidelines and emphasizes simplicity and maintainability.
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 casconf-0.2.0.tar.gz.
File metadata
- Download URL: casconf-0.2.0.tar.gz
- Upload date:
- Size: 55.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d5287cf9f794911912a26fc59a4dc6d41cccd1b5063d39bc425c3d85c2b1bf9c
|
|
| MD5 |
9832ebb87bab5edd43199071d99eb52b
|
|
| BLAKE2b-256 |
a5916522f121d9c417239085a872594c874c4584327da290a730d2e72e246e89
|
Provenance
The following attestation bundles were made for casconf-0.2.0.tar.gz:
Publisher:
release.yaml on ConsoleCatzirl/casconf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
casconf-0.2.0.tar.gz -
Subject digest:
d5287cf9f794911912a26fc59a4dc6d41cccd1b5063d39bc425c3d85c2b1bf9c - Sigstore transparency entry: 1101665641
- Sigstore integration time:
-
Permalink:
ConsoleCatzirl/casconf@0a5073bf539a5440450c40048ab0490de6342112 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ConsoleCatzirl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@0a5073bf539a5440450c40048ab0490de6342112 -
Trigger Event:
push
-
Statement type:
File details
Details for the file casconf-0.2.0-py3-none-any.whl.
File metadata
- Download URL: casconf-0.2.0-py3-none-any.whl
- Upload date:
- Size: 29.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8ce1c9de5267d98872363a0d7bfba0da211af97daa664529b021e1fedac73f13
|
|
| MD5 |
568ec34cf8c6c9fc1c1e18920adb3626
|
|
| BLAKE2b-256 |
cbecaff42202dd0031d5b676dd6361d31f2d1c7880b02af452993d468d1372e1
|
Provenance
The following attestation bundles were made for casconf-0.2.0-py3-none-any.whl:
Publisher:
release.yaml on ConsoleCatzirl/casconf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
casconf-0.2.0-py3-none-any.whl -
Subject digest:
8ce1c9de5267d98872363a0d7bfba0da211af97daa664529b021e1fedac73f13 - Sigstore transparency entry: 1101665931
- Sigstore integration time:
-
Permalink:
ConsoleCatzirl/casconf@0a5073bf539a5440450c40048ab0490de6342112 -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ConsoleCatzirl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yaml@0a5073bf539a5440450c40048ab0490de6342112 -
Trigger Event:
push
-
Statement type: