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,checkedsizes). There is nounwrapor 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
Ownedguard. An error path drops it exactly once. Lists are filled withPyList_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_INCREFinlines) 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.15
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| jaro_native-0.1.15.tar.gz | 16.9 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| jaro_native-0.1.15-cp310-abi3-win_amd64.whl | CPython 3.10 | abi3 | Windows x86-64 | Details |
| jaro_native-0.1.15-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.15-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.10 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| jaro_native-0.1.15-cp310-abi3-macosx_11_0_arm64.whl | CPython 3.10 | abi3 | macOS 11.0+ ARM64 | Details |
| jaro_native-0.1.15-cp310-abi3-macosx_10_12_x86_64.whl | CPython 3.10 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 998.1 kB
Release files / jaro_native-0.1.15.tar.gz
| Download URL | jaro_native-0.1.15.tar.gz |
|---|---|
| Size | 16.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
db2fcb060f214704459054ace242429f7d4aead29b3e9d2712220bb19e1c021a
|
|
BLAKE2b-256 checksum How to use checksums |
e76adb69b8636997348718befb189f0eae66d915c09f0bc35bd6dbc45bbfed55
|
| 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 logRelease files / jaro_native-0.1.15-cp310-abi3-win_amd64.whl
| Download URL | jaro_native-0.1.15-cp310-abi3-win_amd64.whl |
|---|---|
| Size | 115.4 kB |
| Tags | CPython 3.10 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
761730b6aa3d4b3841754ce668626f35e3c65f7592fc4c9dcfe727afc9b26157
|
|
BLAKE2b-256 checksum How to use checksums |
99987125f226a1df64eb51e0bd92da1fc239d836a55614ccf0aed0946f1ade82
|
| 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 logRelease files / jaro_native-0.1.15-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | jaro_native-0.1.15-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 223.3 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
cfac3c1d91e98a5f051f90b7c731da2b3483fb02bbd10806632eac1e7d86027f
|
|
BLAKE2b-256 checksum How to use checksums |
40722ec66ddb123b02963495495b6a44797870b1b2041bca0ef8e21c584d9db4
|
| 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 logRelease files / jaro_native-0.1.15-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | jaro_native-0.1.15-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 222.9 kB |
| Tags | CPython 3.10 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
5c8e25893fd646083034dc3048f8f67e96443b08a6a332f5b09b988bfed465f2
|
|
BLAKE2b-256 checksum How to use checksums |
ede7546ae16811b7de3deb5a82e69f0bb2889c61d18e84e7ef906531030b102e
|
| 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 logRelease files / jaro_native-0.1.15-cp310-abi3-macosx_11_0_arm64.whl
| Download URL | jaro_native-0.1.15-cp310-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 205.7 kB |
| Tags | CPython 3.10 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
2b0444d4d587a313beffc54ac456e35fb8bc6862f4aa16b215dc0e4c6cda41bf
|
|
BLAKE2b-256 checksum How to use checksums |
e33e47657771d675abb958a882bb7f55f77d831d9faa6d7fad570e3eb35b7392
|
| 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 logRelease files / jaro_native-0.1.15-cp310-abi3-macosx_10_12_x86_64.whl
| Download URL | jaro_native-0.1.15-cp310-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 213.9 kB |
| Tags | CPython 3.10 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
ce5751de5b70147e4d7181114e9102be86d923011e2df370c5c3dc2c1784a92f
|
|
BLAKE2b-256 checksum How to use checksums |
ba51c5c24b530a037dce940dbba14a08b718427201592a3831666a17439cf48b
|
| 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