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

# Install from PyPi
pip install cfglock

# Initialize a lockfile
configlock init my_config.yaml

# Sync after changes
configlock sync my_config.yaml

If you want to develop locally from the repository:

Quick start (locally)

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 (editable mode):

pip install -e .

Run the command directly after install:

configlock --help

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.

CLI

Usage:

$ [OPTIONS] COMMAND [ARGS]...

Options:

  • --install-completion: Install completion for the current shell.
  • --show-completion: Show completion for the current shell, to copy it or customize the installation.
  • --help: Show this message and exit.

Commands:

  • init: Reads a YAML config and generates a lockfile.
  • sync: Used to check if lock file and proposed...
  • lock: Used to update the lock file, IF compatible

init

Reads a YAML config and generates a lockfile.

Usage:

$ init [OPTIONS] FILE_PATH

Arguments:

  • FILE_PATH: the path for the newly proposed file [required]

Options:

  • --help: Show this message and exit.

sync

Used to check if lock file and proposed file are out of sync

Usage:

$ sync [OPTIONS] FILE_PATH

Arguments:

  • FILE_PATH: the path for the newly proposed file [required]

Options:

  • --help: Show this message and exit.

lock

Used to update the lock file, IF compatible

Usage:

$ lock [OPTIONS] FILE_PATH

Arguments:

  • FILE_PATH: the path for the newly proposed file [required]

Options:

  • --order-matters / --no-order-matters: choose if the order of the keys matter or not [default: no-order-matters]
  • --help: Show this message and exit.

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.

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.5.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.5-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cfglock-0.1.5.tar.gz
  • Upload date:
  • Size: 6.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.5.tar.gz
Algorithm Hash digest
SHA256 59b8521612937d9d9025253d1a2896b0961afacf8f6b46bf7e3ea7adc03dd1f8
MD5 5103ac3b5ac8eb3abdb9929b08f9e482
BLAKE2b-256 59742ce6ba29f0f27aedfaacbf583369b0b9f434b165dffb337e51f6d9352f72

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cfglock-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.23 {"installer":{"name":"uv","version":"0.11.23","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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 c7690c3ad428d5c2c521b3119b375123118ebf336e3d4d7dfa2c016e8df8aec3
MD5 65ed2ceaefaeb79030fef79b31c62c3e
BLAKE2b-256 a3ef16393972c34e1cb5f2628fb207f6d5a86f01bdd1814cf78e464344ff782c

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