--- id: cfgv version: "3.5.0" license: MIT license_treatment: permissive maintenance: active --- # cfgv — Validate configuration and produce human readable error messages. License: permissive · Maintenance: active · Popularity: top 1,000 on PyPI ## Install pip install cfgv uv add cfgv poetry add cfgv ## Description [![build status](https://github.com/asottile/cfgv/actions/workflows/main.yml/badge.svg)](https://github.com/asottile/cfgv/actions/workflows/main.yml) [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/asottile/cfgv/main.svg)](https://results.pre-commit.ci/latest/github/asottile/cfgv/main) cfgv ==== Validate configuration and produce human readable error messages. ## Installation ```bash pip install cfgv ``` ## Sample error messages These are easier to see by example. Here's an example where I typo'd `true` in a [pre-commit](https://pre-commit.com) configuration. ``` pre_commit.clientlib.InvalidConfigError: ==> File /home/asottile/workspace/pre-commit/.pre-commit-config.yaml ==> At Config() ==> At key: repos ==> At Repository(repo='https://github.com/pre-commit/pre-commit-hooks') ==> At key: hooks ==> At Hook(id='flake8') ==> At key: always_run =====> Expected bool got str ``` ## API ### `cfgv.validate(value, schema)` Perform validation on the schema: - raises `ValidationError` on failure - returns the value on success (for convenience) ### `cfgv.apply_defaults(value, schema)` Returns a new value which sets all missing optional values to their... ## AI interpretation — verify before relying cfgv validates configuration data structures and produces human-readable error messages that pinpoint exactly where validation failed, with support for nested maps, arrays, and conditional validation rules. Verdict: cfgv is a lightweight, well-maintained validation library with zero dependencies, permissive licensing, and no known vulnerabilities. It is suitable for projects needing schema-driven configuration validation with detailed error reporting. [View on SkillFed](https://skillfed.io/packages/cfgv) · [View on PyPI](https://pypi.org/project/cfgv/)