Skip to main content

blendconf

A powerful CLI tool for merging and converting configuration files across different formats.

Features

  • 🔀 Merge multiple config files - Combine configurations from different sources
  • 🔄 Format conversion - Convert between JSON, YAML, TOML, and ENV formats
  • 📤 Flexible output - Write to file or print to stdout
  • 🎯 Simple CLI - Easy to use command-line interface

Supported Formats

  • JSON (.json)
  • YAML (.yaml, .yml)
  • TOML (.toml)
  • ENV (.env)

Installation

We recommend using uv for the best experience, alternative install methods are available here.:

# Install uv (if you haven't already)
curl -LsSf https://astral.sh/uv/install.sh | sh

Then, you can run blendconf directly without installation:

# Run blendconf directly with uvx (no installation needed!)
uvx blendconf --help

Usage

Merge Configuration Files

Merge multiple config files and save the result:

uvx blendconf config1.json config2.json -o merged.json

Merge configs and print to stdout:

uvx blendconf config1.toml config2.toml

The output format is determined by the first input file when printing to stdout, or by the output file extension when using -o.

Convert Between Formats

Convert a JSON file to TOML:

uvx blendconf config.json -o config.toml

Convert YAML to JSON:

uvx blendconf settings.yaml -o settings.json

Print converted file to stdout (uses input file format by default):

uvx blendconf config.json  # outputs as JSON

Merge Strategy

You can specify how configs should be merged using the --strategy or -s option:

uvx blendconf base.yaml overrides.yaml -o final.yaml --strategy replace

Available strategies:

  • replace (default): Later values replace earlier ones
  • append: Lists are concatenated, dictionaries are merged

Examples

Check out the examples directory for sample configuration files:

# Merge two JSON configs
uvx blendconf examples/config1.json examples/config2.json -o merged.json

# Convert JSON to TOML
uvx blendconf examples/config1.json -o config.toml

# Merge YAML and TOML (prints as YAML)
uvx blendconf examples/settings.yaml examples/overrides.toml

# Merge and convert to different format
uvx blendconf examples/settings.yaml examples/overrides.toml -o final.json

Example: Merging Configs

config1.json:

{
  "database": {
    "host": "localhost",
    "port": 5432
  },
  "logging": {
    "level": "INFO"
  }
}

config2.json:

{
  "database": {
    "host": "production.db.example.com",
    "username": "admin"
  },
  "api": {
    "timeout": 30
  }
}

Result:

$ uvx blendconf config1.json config2.json
{
    "database": {
        "host": "production.db.example.com",
        "port": 5432,
        "username": "admin"
    },
    "logging": {
        "level": "INFO"
    },
    "api": {
        "timeout": 30
    }
}

Library Usage

While blendconf is primarily designed as a CLI tool, you can also use it as a Python library:

from pathlib import Path
from blendconf import merge_configs, dump_file, MergeStrategy

# Merge configs
merged = merge_configs(
    [Path("config1.json"), Path("config2.json")],
    MergeStrategy.REPLACE
)

# Save result
dump_file(merged, Path("output.yaml"), "yaml")

Note: The library currently has dependencies on typer and rich (used by the CLI). If you want to use blendconf as a library-only package without these dependencies, PRs are welcome! 🙏

Development

# Clone the repository
git clone https://github.com/hwmrocker/blendconf.git
cd blendconf

# Install dependencies with uv
uv sync

# Run tests
uv run pytest

# Run the CLI locally
uv run blendconf --help

Contributing

Contributions are welcome! Feel free to:

  • Report bugs
  • Suggest new features
  • Submit pull requests
  • Improve documentation

Especially welcome: PRs to make the library usable without CLI dependencies!

License

See LICENSE file for details.

Metadata

Release files for blendconf 1.0.1

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

Source distribution (sdist)

Source distribution for blendconf 1.0.1
File Size Uploaded
blendconf-1.0.1.tar.gz 5.4 kB Details

Built distribution (wheel)

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

Total release size: 12.2 kB

Release files / blendconf-1.0.1.tar.gz

Download URL blendconf-1.0.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
45f6d3797af92c1df808b74fe4987b51d46ccc01a8402c640a07ecbe1ff50263
BLAKE2b-256 checksum
How to use checksums
7096a86ed6b253628bc693a9c3a2da431739d50614129be94ed6d8e1b69ce616
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 15, 2026.

Transparency log

Release files / blendconf-1.0.1-py3-none-any.whl

Download URL blendconf-1.0.1-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2ad007d516db78440b8c823ac1129521f381e53852618c678e3658fd13a3ca9f
BLAKE2b-256 checksum
How to use checksums
b5f2ac646ed7dfcba6e8d9bae3d803956c11c638ac08125da16356b4827d65d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jan 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0.0

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