Skip to main content

The official Python engine for the ConfigLock ecosystem

Project description

CI Status Python Version

ConfigLock

ConfigLock is a lightweight CLI tool designed to prevent production outages by configuration errors. It brings the concept of Lockfiles (inspiration from uv) to your application’s .yaml or .json configurations.

Quick start

# Clone the repo
git clone https://github.com/phalberg/configlock
cd configlock

# Install dependencies
uv sync

# Initialize a lockfile
uv run configlock init my_config.yaml

# Sync after changes
uv run configlock sync my_config.yaml

If you wish to not write uv each time, you can do as such:

CLI Usage

Install the project in editable mode while developing:

pip install -e .

Run the command directly after install:

configlock --help
configlock init {path_to_your_file}
configlock lock {path_to_your_file}
configlock sync {path_to_your_file}

Preview the docs locally with hot reload:

uv run docs-serve

Status

ConfigLock is a personal hobby project focused on learning robust CLI development and structural validation logic.

[!NOTE] This project is in an early prototype stage. It is a learning exercise in building developer tools with Python and Typer.

Roadmap

  • Basic CLI integration with Typer
  • GitHub Actions CI/CD pipeline
  • Recursive Type & Structure checking
  • GitHub API integration (Fetch remote configs)
  • Web-based UI for configuration visualization

The problem

In modern DevOps, non-technical team members often need to edit configuration files (YAML/JSON). One missing key or a wrong data type (e.g., entering a string where a boolean is expected) may crash a production environment.

Init

init: Analyzes your YAML/JSON and creates a config.lock.json that stores the required structure and types.

Note: ConfigLock generates one unique lockfile corresponding to the file path provided.

Sync

sync: Compares your current YAML/JSON against the lockfile. If a key is missing or a type has changed, you get an error.

Lock

lock: Checks your current YAML/JSON and tries to replace the locked file with the new changed current file, if the change is not compatible, you get an error.

Lock with strict ordering

Please use the command:

configlock lock {path_to_your_file} --order-matters

If the order of the keys matter, if not the default:

configlock lock {path_to_your_file} --no-order-matters

will be set.

License

This project is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cfglock-0.1.1.tar.gz (6.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cfglock-0.1.1-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file cfglock-0.1.1.tar.gz.

File metadata

  • Download URL: cfglock-0.1.1.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cfglock-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1240438e314a9e266d8fcbf0b1c2d93fc1d9af4df8473730b6a5d0b678987696
MD5 dc26be8b4687f4633a47c3dc8958a73e
BLAKE2b-256 35eab92330308357a007fdf8d7765b195569b912a6b7250f57aff6197366b541

See more details on using hashes here.

File details

Details for the file cfglock-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cfglock-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 8.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.21 {"installer":{"name":"uv","version":"0.11.21","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for cfglock-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 54ad1834cc7506effa25da40c89fd22ec3aef1431fda92854880181892bfdd53
MD5 7ac9c95f2bc6deb5ea45ed71a6c951b8
BLAKE2b-256 d615fa58a10ffeee1ddc361a4e84bc7b503884c552eb23dee06d97be13833da2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page