Skip to main content

jaro-native

Optional native decoder for the JARO binary format. It is a Rust and PyO3 extension. It exposes one function:

import jaro_native
value = jaro_native.loads_binary(data)  # bytes, bytearray or memoryview

The result matches the pure-Python jaro.binary.loads_binary: dict, list, str, int (int64), float, bool and None. Integral floats below 2^53, and zero, are ints. Invalid input raises jaro_native.JaroError, a subclass of ValueError. The error has .message and .offset, and the text is jaro: offset N: message, as in the pure decoder.

This is a prototype. It decodes binary only. There is no encoder and no text decoder.

Build and install

Use a virtual environment. Do not install into the system Python.

python3 -m venv .venv
.venv/bin/pip install maturin==1.15.0 pytest
unset CONDA_PREFIX                      # maturin refuses to run when both CONDA_PREFIX and VIRTUAL_ENV are set
VIRTUAL_ENV=$PWD/.venv PATH=$PWD/.venv/bin:$PATH maturin develop --release

If CONDA_PREFIX is set and VIRTUAL_ENV is not, maturin develop installs into the conda environment. Activate the venv first.

Wheels

The crate uses PyO3 with the abi3-py310 feature. One wheel serves every CPython 3.10 or later on the same platform. maturin build --release on macOS arm64 produces jaro_native-0.1.0-cp310-abi3-macosx_11_0_arm64.whl, about 208 KB. The wheel has no Python dependencies. PyPy and free-threaded builds are not supported. Build one wheel per OS and CPU, for example with maturin build --release --target universal2-apple-darwin or the manylinux images.

The versions pinned for the build: maturin 1.15.0 (released 2026-08-24) and pyo3 0.29.2 (released 2026-08-05). Cargo.lock pins the transitive crates.

Tests and benchmark

.venv/bin/python -m pytest tests        # needs ../py/src for the pure encoder and decoder (added to sys.path)
.venv/bin/python bench/native_bench.py [rounds]

The tests cover the conformance vectors (good and bad), the six corpus files (binaries from the Go CLI when go is installed, else from the pure encoder), 2,500 random trees against the pure decoder, 30,000 mutated inputs that must give the same value or the same error message as the pure decoder, depth and size limits, a 512 KB-stack thread, and RSS growth over 10,000 rounds.

Safety notes

  • Every input-dependent read uses checked access (get, checked sizes). There is no unwrap or index on input-dependent paths. Panics stay in the default unwinding mode, so a bug becomes a Python exception and not an abort.
  • The decoder checks tags, counts against the remaining input, rows at 8 times the remaining bytes, the node budget (4M plus 32 per input byte), depth 512, UTF-8 validity, anchors, presence bitmaps with padding bits, non-finite floats, duplicate keys and bad pool references.
  • Every strong reference lives in an Owned guard. An error path drops it exactly once. Lists are filled with PyList_SetItem, which also steals the reference on failure.
  • Table row dicts are owned by the result list from creation, so an early error frees them with the list.
  • The decoder holds the GIL for the whole call.
  • Under abi3 the interpreter-internal macros (PyList_SET_ITEM, Py_INCREF inlines) are not available. Reference counting and list stores are function calls. This costs some speed against a version-specific build.
  • Anchored values are copied with the same node budget as the pure decoder (2^24).

Metadata

Release files for jaro-native 0.1.17

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-native 0.1.17
File Size Uploaded
jaro_native-0.1.17.tar.gz 17.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for jaro-native 0.1.17
File
jaro_native-0.1.17-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
jaro_native-0.1.17-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details
jaro_native-0.1.17-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details
jaro_native-0.1.17-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details
jaro_native-0.1.17-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details

Total release size: 1.0 MB

Release files / jaro_native-0.1.17.tar.gz

Download URL jaro_native-0.1.17.tar.gz
Size 17.7 kB
Tags Source
SHA-256 checksum
How to use checksums
3ecc132ebe6f695bae023ffa1a93a5e4be124fdb55cb3a3da4fc0109587a93a3
BLAKE2b-256 checksum
How to use checksums
5c3df4c54800d0a26724a0dd9795cdd100ddfbe51b1c11c24b422fb6827a5aa1
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_native-0.1.17-cp310-abi3-win_amd64.whl

Download URL jaro_native-0.1.17-cp310-abi3-win_amd64.whl
Size 116.3 kB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
717df88e766cfebbc5369361bfa2e4f33b082795a1aa041618d8981310e42c03
BLAKE2b-256 checksum
How to use checksums
8e4b9c29db16d1a72b10898388c1a2c216ca19926c14a7e024d39aee8270798d
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_native-0.1.17-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL jaro_native-0.1.17-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 224.2 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
52aa484df4d5638d0e56581cd6cdd0bd3a42347f22c36391d4e17713085b2a01
BLAKE2b-256 checksum
How to use checksums
cd335f4ee2bc3d8f42d1fec21d8930908b7cbd6d9b42ae2763002ed1c64c1676
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_native-0.1.17-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL jaro_native-0.1.17-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 223.8 kB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
5d328f0f0c5d000dded4de586297d0bfd99e7ed56de869c7780eaf5c1e04a704
BLAKE2b-256 checksum
How to use checksums
0de8696092bf2b26dc300e71b3eb99eba8ad507888131caa472aaf0b52f59633
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_native-0.1.17-cp310-abi3-macosx_11_0_arm64.whl

Download URL jaro_native-0.1.17-cp310-abi3-macosx_11_0_arm64.whl
Size 206.5 kB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
a529ffb3ed71c9cd9ba538830f1b9a5a4b16f2eb72758dc4bc23c30b49f1afde
BLAKE2b-256 checksum
How to use checksums
17d2209a27ae13dfeb3118d3e1f16a450be3d5e5cee9acb1b724ad195c34d6b6
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_native-0.1.17-cp310-abi3-macosx_10_12_x86_64.whl

Download URL jaro_native-0.1.17-cp310-abi3-macosx_10_12_x86_64.whl
Size 214.8 kB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4246d09f7d5cce16d2719d5c47b75b9845b9fbf258b09d3be1b7f4eadd345867
BLAKE2b-256 checksum
How to use checksums
6686eda141b57cad2c0f92af7c87433de668c4b19dbee3693aa7437cf36ca68c
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

This release

0.1.17 This release

6 release files

0.1.15

6 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