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.0.tar.gz (6.6 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.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cfglock-0.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cfglock-0.1.0.tar.gz
Algorithm Hash digest
SHA256 470f1fb2a5b8f37caf60674fb0f8f8c4479bf000a5ec9f5041255118bcdffa76
MD5 3bc9a221da8fc80ffcf79edc26f2c83a
BLAKE2b-256 490b69d91636c9330f68dd23cbd2788aabd09cc400445d1553d864910a79907b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cfglock-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.14 {"installer":{"name":"uv","version":"0.11.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for cfglock-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 690337be44e7912e93252606b415c1814f489613d54c2906df5715da4ed70072
MD5 a0eb44e3dbe6b93bd30ce4b826e3f8ed
BLAKE2b-256 2cfa96a443e45b2f3bba24c3aee60ef5385f2514742e733111d2c962c3249812

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