skillfed

voluptuous

Python data validation library

voluptuous v0.16.0 6.9M downloads/30d#1,820 on PyPI1,850
Permissive license BSD-3-Clause Active released

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 voluptuous

uv

uv add voluptuous

poetry

poetry add voluptuous

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.9

Tags

python data validation libraryschema validation json yamlvalidate nested data structuresinput validation with error messagesdeclarative schema validationpython dict validationstructured data validation
validationschemadata-validation

More Software Development packages