voluptuous
Python data validation library
What it is and what it does
Voluptuous is a Python data validation library designed to check incoming data (from JSON, YAML, APIs, etc.) against a schema you define. Rather than writing custom validation code, you describe your data structure using simple Python types and callables—dictionaries, lists, type checks, and custom validators—and Voluptuous matches input against that schema, raising detailed exceptions when validation fails.
The library prioritizes simplicity and useful error messages. Schemas are just Python data structures: `{int: str}` means a dict with integer keys and string values, `[int, float, str]` means a list containing only those types. You can nest schemas arbitrarily and compose validators using functions like `Required`, `All`, `Range`, and `Length`. When validation fails, you get a clear path to the problem in your data.
Use it for:
- Validate API request parameters before processing them in a web service.
- Check configuration files (JSON/YAML) match expected structure at application startup.
- Enforce data contracts in data pipelines before passing records downstream.
- Validate form submissions or user input in web applications.
- Ensure nested data structures from external sources conform to expected types and constraints.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Voluptuous validates Python data structures (dictionaries, lists, nested objects) against declarative schemas, raising detailed exceptions when data doesn't match.
Yes, if you need straightforward schema validation for structured data. Voluptuous is stable, has no dependencies, and is widely used. The contributions-only maintenance model is a trade-off: expect community-driven fixes and no proactive feature work, but the core library is mature and unlikely to need frequent changes. Choose it if you prefer declarative schemas over class-based validators.
Install
voluptuous on PyPI
pip
pip install voluptuousuv
uv add voluptuouspoetry
poetry add voluptuousInstalling voluptuous
Before you install
Low friction—pure Python wheel with no runtime dependencies. Actively maintained with recent releases; however, the maintainer has stated the project is in contributions-only mode and no longer uses it personally, so expect community-driven fixes rather than proactive feature development.
License in practice
BSD-3-Clause is permissive; you may use, modify, and distribute voluptuous freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install voluptuous
from voluptuous import Schema, Required, All, Range
schema = Schema({
Required('q'): str,
'per_page': All(int, Range(min=1, max=20)),
})
result = schema({'q': 'search term', 'per_page': 10})
Requires Python 3.9 or later.
Verify before relying
- Performance characteristics on very large or deeply nested data structures.
- Extent of community support and PR review turnaround given contributions-only status.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 239 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 6,890,471/month — #1,820 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: voluptuous-0.16.0-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
voluptuous-serializeConverts Voluptuous schema objects into…
permissive · top 15,000 on PyPI
voluptuous-openapiConverts Voluptuous validation schemas into…
permissive · top 15,000 on PyPI
schemaValidates Python data structures (dicts, lists,…
permissive · top 1,000 on PyPI
jsonschemajsonschema validates Python data structures…
permissive · top 100 on PyPI
xmlschemaValidates XML documents against XSD schemas and…
permissive · top 5,000 on PyPI
avro-validatorValidates Python data against Avro schemas and…
permissive · top 15,000 on PyPI
yamaleYamale validates YAML files against a schema…
permissive · top 5,000 on PyPI
jsonschema-rsjsonschema-rs validates JSON data against JSON…
permissive · top 5,000 on PyPI
zope.schemaDefines structured data schemas for Python…
unclear · top 5,000 on PyPI
fastjsonschemaValidates JSON data against JSON Schema…
permissive · top 1,000 on PyPI