Skip to main content

corvus-json-schema-rs

A JSON Schema evaluator for Python (draft 4, 6, 7, 2019-09 and 2020-12) backed by the corvus-json-schema Rust crate, the Rust port of the Corvus.Text.Json V5 standalone evaluator. It has the same API as the pure-Python corvus-json-schema package, so either can be imported in place of the other.

  • Conformant: passes the JSON-Schema-Test-Suite (required, optional and optional/format, every draft) except draft4/optional/zeroTerminatedFloats.json, which the C# and Rust evaluators exclude (they read 1.0 as an integer), and all of the suite's annotation tests.
  • Fast: instances are read in place through CPython's C API (dicts, lists and strings are not copied), so validating a Python object costs the evaluation alone. Over the jsonschema-benchmark corpora it takes 0.35 of the pure package's time and 0.72 of jsonschema-rs's (geometric means); see the pure package's Performance section for the figures.
  • Every platform from one wheel per platform: the extension uses the stable ABI (abi3), so one wheel serves CPython 3.10 and every later version. Wheels are built for Linux (x86_64 and aarch64, glibc and musl), macOS (universal2: Intel and Apple silicon) and Windows (x64, and arm64 from Python 3.11, CPython's oldest arm64 Windows release), and CI tests each on its own platform.

Install

pip install corvus-json-schema-rs

Usage

import corvus_json_schema_rs as cjs

validate = cjs.compile({"type": "object", "required": ["id"], "properties": {"id": {"type": "integer"}}})
validate({"id": 3})                    # True: a value as json.loads produces it, read in place
validate.is_valid_json('{"id": "3"}')  # False: JSON text, parsed in Rust

compile takes the same options as the pure package (default_dialect, assert_format, formats, resolve_document, base_uri, entry_point, max_depth and the rest, as keywords or a CompileOptions), and evaluate, JsonSchemaResultsCollector, ResultsLevel and collect_annotations work as they do there. Custom formats and document resolvers are Python callables, called from Rust.

What differs from the pure package:

  • There is no generated source: no Validator.source and no generate_module.
  • is_valid_json(text) validates JSON text (str or bytes) without creating Python objects for it.
  • Subclasses of dict, list, str, int and float (an OrderedDict, a string enum) are read as their bases, and tuples as arrays.
  • Integers beyond 64 bits are compared as the nearest double, as by a JSON parser without arbitrary precision.
  • A string with a lone surrogate (which json.loads can produce) is read with U+FFFD in its place.

How it works

The crate compiles the schema once into its node graph and fail-fast plans (see src-rs/corvus-json-schema). The evaluator is generic over an Instance trait (a value shown as one of the six JSON kinds, with arrays and objects read in place). This package implements it over Python objects through the stable C API: a dict is walked with PyDict_Next and searched by scanning its keys (or, when large, by lookup), a string is read as the UTF-8 that CPython keeps with it (no copy for ASCII strings), and a list is read by index. Anything the reader cannot take exactly (a tuple, a key that is not a string, a lone surrogate, a number beyond a double, very deep nesting) makes the call convert the instance to a serde_json::Value and evaluate that instead, so results never depend on which path ran.

Building

pip install maturin
maturin develop --release   # into the active virtual environment
maturin build --release     # a wheel for this platform

The Rust toolchain is pinned in ../rust-toolchain.toml. The tests are tests/test_binding.py and, through --impl corvus_json_schema_rs, the pure package's suite and results tests.

Metadata

Release files for corvus-json-schema-rs 0.1.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 corvus-json-schema-rs 0.1.3
File Size Uploaded
corvus_json_schema_rs-0.1.3.tar.gz 142.9 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for corvus-json-schema-rs 0.1.3
File
corvus_json_schema_rs-0.1.3-cp310-abi3-win_arm64.whl CPython 3.10 abi3 Windows ARM64 Details
corvus_json_schema_rs-0.1.3-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
corvus_json_schema_rs-0.1.3-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details
corvus_json_schema_rs-0.1.3-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details
corvus_json_schema_rs-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
corvus_json_schema_rs-0.1.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
corvus_json_schema_rs-0.1.3-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl CPython 3.10 abi3 macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64), macOS 11.0+ ARM64 Details

Total release size: 12.7 MB

Release files / corvus_json_schema_rs-0.1.3.tar.gz

Download URL corvus_json_schema_rs-0.1.3.tar.gz
Size 142.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a30061fbdd7667b07ae1d3164a049531b037fdcb3cb390e05096cf9142acab74
BLAKE2b-256 checksum
How to use checksums
150a1930b2d35a5c31466199dc4946547eaf0373c33fda9d0473ed4f4dd6f47a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / corvus_json_schema_rs-0.1.3-cp310-abi3-win_arm64.whl

Download URL corvus_json_schema_rs-0.1.3-cp310-abi3-win_arm64.whl
Size 1.4 MB
Tags CPython 3.10 Windows ARM64 abi3
SHA-256 checksum
How to use checksums
4af9ec3018a3bcb896d49852b88502f2584e0c07d67899af1a2e9def4081057c
BLAKE2b-256 checksum
How to use checksums
2d6a61e56f5050d7fcd5a31e164362df33eb60dffae0ebc6c5097b4bc88d7f45
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / corvus_json_schema_rs-0.1.3-cp310-abi3-win_amd64.whl

Download URL corvus_json_schema_rs-0.1.3-cp310-abi3-win_amd64.whl
Size 1.5 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c62a91e458b249e0412732773ceaf7dad8f94e832b9e1d808da1a6d1672a9fd7
BLAKE2b-256 checksum
How to use checksums
35ba8b98ccb6c05debd1862201ab166f7af5ac554cfd7ac2a882782ad7aa38f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / corvus_json_schema_rs-0.1.3-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL corvus_json_schema_rs-0.1.3-cp310-abi3-musllinux_1_2_x86_64.whl
Size 1.9 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
a749fd283772d66cf01110b2fde9e587370ca9b8336da0716762f9028c5bfae8
BLAKE2b-256 checksum
How to use checksums
653b8593138e950897d1e524b1d933260fa295bfbc26494f41c4c7ef26b34f76
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / corvus_json_schema_rs-0.1.3-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL corvus_json_schema_rs-0.1.3-cp310-abi3-musllinux_1_2_aarch64.whl
Size 1.7 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
edbd2f9d31b5b86d3c5c53e9e5e7ab256f9987d152230f5980eb3c3a45dc54d1
BLAKE2b-256 checksum
How to use checksums
689d6b91f3de737081b28f311a5b195d3ea6dce44703957e29e4c90f78218b3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / corvus_json_schema_rs-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL corvus_json_schema_rs-0.1.3-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
34a095c4a70fc2640b420ed5fcab3cf8ec7ee9ba88c49c5c1b62a597d6682d77
BLAKE2b-256 checksum
How to use checksums
aa5eda7ee535cdb56a63a05408e2ef43f3e2d2573d19b3b39c271906fef13a91
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / corvus_json_schema_rs-0.1.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL corvus_json_schema_rs-0.1.3-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 1.6 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
b2737cd6e7d011e7158020606f3b4a285d7310fa828e79ea3db2b302eb57ba7e
BLAKE2b-256 checksum
How to use checksums
29bed980ee23dcaa111ed7542925e97dbc5c09a190306f01c8c855fd10134811
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release files / corvus_json_schema_rs-0.1.3-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl

Download URL corvus_json_schema_rs-0.1.3-cp310-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Size 2.9 MB
Tags CPython 3.10 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7ddbfaec580c064bed004041707d6e67b704dfe0d70afcda8ba73f5d6c735008
BLAKE2b-256 checksum
How to use checksums
4037851f8809b706202e57aad46fa912ac8bb3ca9b8a15d01b7b40e007618e98
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 9, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.4

8 release files

This release

0.1.3 This release

8 release files

0.1.2

8 release files

0.1.1

8 release files

0.1.0

8 release files

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