Skip to main content

convert json schemas to voluptuous schemas

Project description


This is a tool and library to convert a JSON Schema to a Voluptuous schema.


from voluptuary import to_voluptuous

# some JSON Schema
json_schema = {
    'type': 'object',
    'properties': {
        'value': {'type': 'integer'},

# convert to a voluptuous schema
schema = to_voluptuous(json_schema)

# validate something
schema({'value': 1})


To run the tests, use tox.

$ tox


This library is for the people who aren’t satisfied with JSON Schema but can’t justify rewriting schemas (“tedious”, “time-consuming”, “little benefit”). But with a library to rewrite the schemas for you, there are no more excuses!

If you are wondering “why voluptuous over JSON Schema”, there are some good reasons listed here. I find voluptuous models to be nicer: more Pythonic, more expressive, easier to read and maintain, easier to customize, better error messages, and so on.

How do I know my converted schema will validate correctly?

First of all, you should always test the validation behavior of your schemas. No library is going to write correct schemas for you.

Aside from that, this library follows the following principles:

  1. Familiar behavior: This library strives to match the validation behavior of the (Draft 4) validator from jsonschema.
  2. Proactive testing: This library includes and actively runs a comprehensive suite of tests to ensure behavior in the first point.
  3. Documentation: This library includes detailed documentation of support for JSON Schema validation features, and strive to keep this up to date.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for voluptuary, version 0.0.3
Filename, size File type Python version Upload date Hashes
Filename, size voluptuary-0.0.3.tar.gz (4.6 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page