Skip to main content

jaro (Python)

Pure-Python codec for JARO, a JSON-model data format with a text form and a binary form. The format is specified in ../SPEC.md. Python 3.10 or later, no runtime dependencies, fully typed.

Install

pip install .            # from this directory
pip install -e '.[dev]'  # tests, mypy and the YAML benchmark

API

import jaro

jaro.dumps({"a": [1, 2.5, None]})            # 'a:[1 2.5 ~]'
jaro.loads("a:[1 2.5 ~]")                    # {'a': [1, 2.5, None]}
jaro.dumps_binary(value, dedup=False)        # bytes
jaro.loads_binary(data)                      # value
  • dumps(value, *, dedup=False) -> str and loads(text: str | bytes) -> Any.
  • dumps_binary(value, *, dedup=False) -> bytes and loads_binary(data: bytes) -> Any.
  • dedup=True replaces repeated sub-trees (24 bytes or more of text) with anchors and references.
  • JaroError subclasses ValueError. Its offset attribute is the byte offset in the input, or None for encoder errors.

Mapping: None, bool, int (int64), float (finite), str, list and dict with str keys. Encoders sort keys. Decoders reject duplicate keys. Integral floats below 2^53 decode as int, and zero is always 0. Tuples, sets and bytes are rejected.

Supported: text and binary forms, anchors, spreads, comments, tables (plain, sparse with ^, keyed {|k| ...}, nested columns key{sub}). Not supported: schema validation, the Parse/Doc arena, HTTP middleware and zstd.

Conformance

tests/test_conformance.py runs ../conformance/vectors.json: every text, binary, badText, badTextHex and badBinaryHex case, a round trip of every trees entry, and byte-exact parity with the Go reference for every vector that has a tree (text, binary and binary with dedup). The parity allowlists in that file are empty.

pytest -q
mypy --strict src

Limits

  • Nesting depth 512, reference expansion 2^24 nodes, binary counts checked against the remaining input and a node budget of 4M plus 32 per input byte. Codecs use about one Python frame per nesting level, so depth 512 works under the default recursion limit. A RecursionError from a very deep caller stack is reported as JaroError.
  • Invalid UTF-8 is rejected on decode. A lone surrogate in a str is rejected on encode.
  • Binary floats that are NaN or infinite are rejected on decode.

Benchmark

python bench/bench.py                 # corpus: $JARO_CORPUS, default ../../corpus

It prints encode and decode milliseconds and output bytes against json and PyYAML (libyaml loader when available), and writes bench/results.json.

Optional native decoder

loads_binary uses the jaro_native Rust extension when it is installed (pip install jaro-native, built from native-py/). Without it, the pure Python decoder runs. Set JARO_PURE=1 to force the pure decoder. jaro.binary.NATIVE reports which one is active. jaro.binary.loads_binary_py always runs the pure decoder.

Metadata

Release files for jaro 0.1.15

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

Source distribution (sdist)

Source distribution for jaro 0.1.15
File Size Uploaded
jaro-0.1.15.tar.gz 39.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for jaro 0.1.15
File Interpreter ABI Platform
jaro-0.1.15-py3-none-any.whl Python 3 none any Details

Total release size: 62.7 kB

Release files / jaro-0.1.15.tar.gz

Download URL jaro-0.1.15.tar.gz
Size 39.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a15a5e16eccea3b58de171f825383d298b72ec3b8d5df232dfc664e9ec19546b
BLAKE2b-256 checksum
How to use checksums
7bfc989ae8c27ba28805dd23d2221e99d9a98050cde75b5d4d27f72d94753dda
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 11, 2026.

Transparency log

Release files / jaro-0.1.15-py3-none-any.whl

Download URL jaro-0.1.15-py3-none-any.whl
Size 23.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
440078d503e7a2058e43b17104918237ead17a9231f8461c560cb2f478f300b2
BLAKE2b-256 checksum
How to use checksums
55abd5966a6797a28b92a24870d9037cf0dd8a90355f3aef6094cc4a5d97f654
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 11, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.17

2 release files

This release

0.1.15 This release

2 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