skillfed

Cerberus

Lightweight, extensible schema and data validation tool for Pythondictionaries.

cerberus v1.3.8 6.7M downloads/30d#1,870 on PyPI3,287
Permissive 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) Active released

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 cerberus

uv

uv add cerberus

poetry

poetry add cerberus

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: ISC License (ISCL)Natural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

python dictionary validationschema validation librarydata validation pythondocument validationschema enforcement
data-validationschema-enforcement

More Quality Assurance packages