Skip to main content

jsonata-rs

Python bindings for the Rust port of jsonata-java.

  • PyPI distribution name: jsonata-rspip install jsonata-rs
  • Import name: jsonataimport jsonata
  • Requires Python ≥ 3.11; published as a single abi3 wheel per platform (Linux amd64 + arm64, macOS arm64).
import jsonata

expr = jsonata.Jsonata("Account.Order.Product.(Price * Quantity) ~> $sum()")
expr.evaluate(data)            # evaluate against a dict / list / scalar

# variable bindings
jsonata.Jsonata("$x + 1").evaluate(None, {"x": 41})   # -> 42

# one-shot convenience
jsonata.evaluate("a + b", {"a": 2, "b": 3})           # -> 5

# custom functions written in Python
e = jsonata.Jsonata("$greet(name)")
e.register_function("greet", lambda n: f"Hello, {n}!")
e.evaluate({"name": "World"})                          # -> "Hello, World!"

Errors raise jsonata.JsonataError with .code (e.g. "S0201") and .position. An internal engine bug (a caught Rust panic) raises jsonata.JsonataInternalError — a subclass of JsonataError, so existing handlers still catch it — with .code == "PANIC" and a .panic_location.

try:
    result = jsonata.Jsonata(expr).evaluate(data)
except jsonata.JsonataError as e:
    print(e.code, e.position)   # e.g. "S0201" 4

Type checking

The package ships PEP 561 type information (a jsonata.pyi stub plus a py.typed marker), so mypy and pyright type the full public API out of the box — including JsonataError.code: str, .position: int, and JsonataInternalError.panic_location: str | None. No stub package to install.

Value mapping

JSONata Python
number int (whole) / float
string str
boolean bool
null None
undefined None
array list
object dict

Building

pip install maturin
maturin build --release -m crates/jsonata-py/Cargo.toml   # wheel in target/wheels/
# or for local dev:
maturin develop --release -m crates/jsonata-py/Cargo.toml

CI (.github/workflows/CI.yml) cross-builds wheels for amd64 + arm64 across Linux (manylinux + musllinux) and macOS with PyO3/maturin-action, and publishes to PyPI with pypa/gh-action-pypi-publish (Trusted Publishing) on tag pushes.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jsonata_rs-0.1.4.tar.gz (438.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

jsonata_rs-0.1.4-cp311-abi3-musllinux_1_2_x86_64.whl (1.9 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ x86-64

jsonata_rs-0.1.4-cp311-abi3-musllinux_1_2_aarch64.whl (1.8 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

jsonata_rs-0.1.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.7 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ x86-64

jsonata_rs-0.1.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.6 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

jsonata_rs-0.1.4-cp311-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

Details for the file jsonata_rs-0.1.4.tar.gz.

File metadata

  • Download URL: jsonata_rs-0.1.4.tar.gz
  • Upload date:
  • Size: 438.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for jsonata_rs-0.1.4.tar.gz
Algorithm Hash digest
SHA256 7062a2d5864876df778ad0fdfa87d71c6bdbe0959b1802324fb1cf3281ce116d
MD5 7111cd08a41c3d2b80ff7c3f33726c4f
BLAKE2b-256 166fe3ab93e241100ce8ee08642d42203748345dfc597f869edf2364b6ac5a04

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonata_rs-0.1.4.tar.gz:

Publisher: CI.yml on localstack/jsonata-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jsonata_rs-0.1.4-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for jsonata_rs-0.1.4-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 c898411aad514f3bfe87df545e16e4d2a9d10e94568ef0684b5a57364b5b9f40
MD5 d4326233eedd85bf02d9174dd82b1874
BLAKE2b-256 7a01ad35b43f8e9f428829c9a7a0c505d417efef7a4933699a9a26c9c5a2f47e

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonata_rs-0.1.4-cp311-abi3-musllinux_1_2_x86_64.whl:

Publisher: CI.yml on localstack/jsonata-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jsonata_rs-0.1.4-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for jsonata_rs-0.1.4-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 1346ead149f0ec35bd80750c7252f352bdacd36e2ee1f1000af7099a000d969a
MD5 6ae64a396537cb69ea790a2aa09e9eae
BLAKE2b-256 28abcbce06d9aa8690eb21928ba6d0db2eee3f9dbbe857befb958dd5377f3990

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonata_rs-0.1.4-cp311-abi3-musllinux_1_2_aarch64.whl:

Publisher: CI.yml on localstack/jsonata-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jsonata_rs-0.1.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for jsonata_rs-0.1.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7e38fda2630ceaa1885ecbadfab43571d9bbc64caf72c8f39238663d88f4bbf7
MD5 280176075a3c0825fafe43bb640b443c
BLAKE2b-256 a28949227a57a30f1725b5dce4151ac38291a316875ddd315233b38294975241

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonata_rs-0.1.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: CI.yml on localstack/jsonata-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jsonata_rs-0.1.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for jsonata_rs-0.1.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 200e7a20891f503ab9ecbde5e14e54a061221a88f747659b96499b6daf4d4cd3
MD5 dd00145fb5dbbd69e541737e8bed6543
BLAKE2b-256 7cac9ce0990f07be9b462c34a17ab5b5d17026ed13cb2efdf16b866888d1aac3

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonata_rs-0.1.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: CI.yml on localstack/jsonata-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jsonata_rs-0.1.4-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jsonata_rs-0.1.4-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d81fa180bf7c15b181a589b4798c83512161a698e9dd8e9762cd5748cc9a2a5e
MD5 5f52e4d60f655d1ba758aed1711552c9
BLAKE2b-256 3cdd163cf600792e5448cf7095ee5a12172ede1cf42f402268fb0dd72ed6c587

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonata_rs-0.1.4-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: CI.yml on localstack/jsonata-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.4 This release

6 files

0.1.3

6 files

0.1.2

6 files

0.1.1

6 files

0.1.0

6 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