Voluptuous is a library for validating data structures using schemas composed from familiar Python values, types and functions. It is particularly useful for checking information received from JSON, YAML and other structured data formats.
The library emphasises readable schema definitions and useful error messages. Developers can describe dictionaries, lists and nested structures directly, rather than building a separate hierarchy of model classes.
Validators can be combined to express conditions such as membership of an allowed set, numerical ranges, string patterns or relationships between several checks. Custom functions can participate in validation, making it possible to enforce requirements specific to an application.
Voluptuous also provides mechanisms for transforming accepted values. Applications can normalize certain inputs while still rejecting records that do not satisfy the required schema.
The result is a flexible approach suited to configuration validation, application input checking and other tasks involving structured information.
This is free and open source software.
Key Features
- Define schemas using dictionaries, lists, types, values and callable functions.
- Validate nested structures and recursive data.
- Mark dictionary entries as Required or Optional.
- Specify default values for optional fields.
- Combine validators using All, Any and other composition helpers.
- Apply Range, Length, Match, In and other built-in constraints.
- Transform accepted values using Coerce and custom functions.
- Choose whether additional dictionary keys are rejected, accepted or removed.
- Use exclusive and inclusive field groups to enforce relationships between keys.
- Return informative exceptions describing failed validation rules.
- Customize validation behaviour using ordinary callable objects.
- Validate lists containing multiple permitted element types.
Website: github.com/alecthomas/voluptuous
Support:
Developer: Alec Thomas and contributors
License: BSD 3-Clause ‘New’ or ‘Revised’ License
Voluptuous is written in Python. Learn Python with our recommended free books and free tutorials.
Related Software
| Python Data Validation | |
|---|---|
| Pydantic | Data validation using Python type hints |
| pandera | Framework for precision data testing |
| jsonschema | Implementation of JSON Schema for Python |
| Cerberus | Lightweight and extensible data validation library |
| schema | Library for validating Python data structures |
| GX | Validating, documenting, and profiling data |
| marshmallow | ORM/ODM/framework-agnostic library |
| Voluptuous | Python data validation library |
| Schematics | Combine types into structures, validate , and transform the shapes of data |
| Colander | Serialization / deserialization / validation library |
| Valideer | Lightweight data validation and adaptation Python library |
| OpenRefine | Desktop program for data cleanup and transformation |
| Soda Core | Data quality and data contract verification engine |
| OpenMetadata | Unified metadata platform |
| Elementary OSS | dbt-native data observability command-line tool |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.