Skip to main content
https://travis-ci.org/pglass/voluptuary.svg?branch=master https://img.shields.io/pypi/v/voluptuary.svg https://img.shields.io/pypi/pyversions/voluptuary.svg

voluptuary

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

Usage

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})

Tests

To run the tests, use tox.

$ tox

Why?

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.

Metadata

Release files for voluptuary 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for voluptuary 0.0.3
File Size Uploaded Provenance
voluptuary-0.0.3.tar.gz 4.6 kB Without provenance Details

Release files / voluptuary-0.0.3.tar.gz

Download URL voluptuary-0.0.3.tar.gz
Size 4.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9710fc8acea4e256ec687761818e9a3426d739db5ba1a1756bec956bd7f8cafb
BLAKE2b-256 checksum
How to use checksums
9fb9d0a6fd8ffb2fcf35330473cd230413334928a8ad4ca9c03fb0fb0a5a1a0c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for voluptuary 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

0.0.3 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page