Cerberus
Lightweight, extensible schema and data validation tool for Pythondictionaries.
What it is and what it does
Cerberus is a lightweight data validation library that checks Python dictionaries and documents against a schema you define. It performs type checking and constraint validation out of the box, and is designed to be easily extended with custom validation logic. The library has no required dependencies beyond importlib-metadata and is maintained to work across modern Python versions from 3.7 onward.
You define a schema as a dictionary specifying field names and their validation rules (type, allowed values, etc.), then create a Validator instance and call validate() on your data. It returns True if the data passes all rules or False if it fails; you can inspect the errors property to see what went wrong. The design prioritizes simplicity and extensibility, making it suitable for validating configuration files, API payloads, form submissions, and other structured data.
Use it for:
- Validate incoming JSON or form data in a web API before processing
- Check configuration files conform to an expected schema before loading
- Enforce data structure constraints in data pipelines or ETL workflows
- Normalize and validate user input in CLI tools or interactive applications
- Define and enforce document schemas for database or document store operations
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Cerberus validates Python dictionaries and documents against a schema, checking types and other constraints with minimal dependencies and extensible custom validation rules.
Yes. Cerberus is a mature, actively maintained library with no known vulnerabilities, permissive ISC licensing, and low install friction. It solves a common problem—validating structured data—with a straightforward API and minimal dependencies. Install it if you need schema validation without the complexity of heavier frameworks.
Install
cerberus on PyPI
pip
pip install cerberusuv
uv add cerberuspoetry
poetry add cerberusInstalling Cerberus
Before you install
Low friction: pure Python wheel with only importlib-metadata as a runtime dependency. Actively maintained with last commit 2026-07-01; supports Python 3.7 through 3.14 and PyPy.
License in practice
ISC License (permissive): you can use, modify, and distribute Cerberus freely in proprietary and open-source projects with minimal restrictions—just retain the copyright notice.
Quickstart
pip install cerberus
from cerberus import Validator
v = Validator({'name': {'type': 'string'}})
result = v.validate({'name': 'john doe'})
print(result) # True
Verify before relying
- Whether custom validators can be extended without modifying the library itself
- Performance characteristics on large or deeply nested schemas
- Adoption metrics and community size beyond repository stars
Package facts
| License | ISC License Copyright (c) 2012-2016 Nicola Iarocci. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — importlib-metadata |
| Maintenance | actively maintained — 281 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,700,879/month — #1,870 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: cerberus-1.3.8-py3-none-any.whl
Keywords: validation, schema, dictionaries, documents, normalization
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
pycsvschemaValidates CSV files against a schema…
permissive · top 15,000 on PyPI
eidoValidates project metadata against PEP schemas…
permissive · top 15,000 on PyPI
swagger-spec-validatorValidates Swagger/OpenAPI specifications…
permissive · top 15,000 on PyPI
cerberus-python-clientA Python client library for reading and writing…
permissive · top 5,000 on PyPI
fastjsonschemaValidates JSON data against JSON Schema…
permissive · top 1,000 on PyPI
jsonschema-pydantic-converterConverts JSON Schema definitions to Pydantic v2…
permissive · top 15,000 on PyPI
check-jsonschemaA command-line tool and pre-commit hook that…
permissive · top 5,000 on PyPI
flexValidates Swagger 2.0 API specifications…
permissive · top 15,000 on PyPI
protoc-gen-validateValidates protocol buffer messages against…
unclear · top 15,000 on PyPI
yamaleYamale validates YAML files against a schema…
permissive · top 5,000 on PyPI