yamale
A schema and validator for YAML.
What it is and what it does
Yamale is a YAML schema validator that lets you define the structure, types, and constraints your YAML files must satisfy, then validates one or many files against that schema. It works both as a command-line tool and as a Python library, making it useful for configuration validation, data pipeline checks, and automated testing of YAML-based inputs.
The package depends only on pyyaml (with an optional ruamel.yaml for YAML 1.2 support) and supports Python 3.8 through 3.14. You write schemas in plain YAML using validators like str(), int(), bool(), enum(), and include() for reusable structures. When validation fails, yamale reports all errors at once rather than stopping at the first one, helping you fix multiple issues in a single pass.
Use it for:
- Validate application configuration files before deployment to catch typos and type mismatches early.
- Enforce schema on YAML data files in CI/CD pipelines to prevent invalid data from entering downstream processes.
- Define and validate structured test fixtures or mock data in test suites.
- Check Kubernetes manifests or other infrastructure-as-code YAML files for correctness.
- Validate user-supplied YAML input in web services or CLI tools before processing.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Yamale validates YAML files against a schema you define, catching structural and type errors before your application processes the data.
Yes. Yamale is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a concrete problem—catching YAML structure errors before they cause runtime failures. It's well-suited for any workflow where YAML files are a critical input and validation overhead is worth the safety gain.
Install
yamale on PyPI
pip
pip install yamaleuv
uv add yamalepoetry
poetry add yamaleInstalling yamale
Before you install
Low friction: pure Python wheel with a single runtime dependency (pyyaml). The package is actively maintained with a recent release and no known vulnerabilities.
License in practice
MIT license is permissive; you can use, modify, and distribute yamale freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install yamale
import yamale
schema = yamale.make_schema('./schema.yaml')
data = yamale.make_data('./data.yaml')
yamale.validate(schema, data)
Requires Python 3.8 or later. Schema and data files must be valid YAML.
Verify before relying
- Performance characteristics when validating large YAML files or many files in parallel.
- Whether the optional ruamel.yaml dependency provides meaningful advantages over the default pyyaml parser in typical workflows.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — pyyaml |
| Maintenance | actively maintained — 267 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,245,504/month — #2,353 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: yamale-6.1.0-py3-none-any.whl
Tags
More Quality Assurance packages
Coverage.py measures which lines of Python code…
permissive · top 1,000 on PyPI
ruffRuff is a Python linter and code formatter…
permissive · top 1,000 on PyPI
pexpectPexpect spawns and controls interactive console…
permissive · top 1,000 on PyPI
blackBlack reformats Python source code to a…
permissive · top 1,000 on PyPI
pytest-xdistpytest-xdist distributes pytest tests across…
permissive · top 1,000 on PyPI
cfn-lintValidates AWS CloudFormation templates in YAML…
permissive · top 1,000 on PyPI
annotatedyamlParses and validates YAML files with support…
permissive · top 15,000 on PyPI
cfgvValidates configuration data against schemas…
permissive · top 1,000 on PyPI
pykwalifyValidates YAML and JSON data against schemas…
permissive · top 5,000 on PyPI
strictyamlStrictYAML parses and validates YAML documents…
permissive · top 1,000 on PyPI
kubernetes-validateValidates Kubernetes resource definitions…
permissive · top 15,000 on PyPI
avro-validatorValidates Python data against Avro schemas and…
permissive · top 15,000 on PyPI
yamlpathQuery, retrieve, update, merge, validate, and…
permissive · top 15,000 on PyPI
zcborzcbor validates and converts YAML/JSON/CBOR…
permissive · top 15,000 on PyPI
colanderColander deserializes and validates data…
permissive · top 15,000 on PyPI
check-jsonschemaA command-line tool and pre-commit hook that…
permissive · top 5,000 on PyPI