Skip to main content

JSONata for Python — Rust port of the jsonata-java reference implementation

Project description

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.

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.

Project details


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.2.tar.gz (124.9 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.2-cp311-abi3-musllinux_1_2_x86_64.whl (1.8 MB view details)

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

jsonata_rs-0.1.2-cp311-abi3-musllinux_1_2_aarch64.whl (1.7 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

jsonata_rs-0.1.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

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

jsonata_rs-0.1.2-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.2-cp311-abi3-macosx_11_0_arm64.whl (1.4 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: jsonata_rs-0.1.2.tar.gz
  • Upload date:
  • Size: 124.9 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.2.tar.gz
Algorithm Hash digest
SHA256 f232870337944191614c9c68c0779dbd3de52a150acb23037c1a0df3739d6e3f
MD5 c1147bf07752bd35dc70a058f3cfe5e8
BLAKE2b-256 39dffb10d2a91ce4a0a2b86b66feb5c1585116e661b9856327d10a6573359701

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonata_rs-0.1.2.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.2-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for jsonata_rs-0.1.2-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 bd578adde193b112d00ef234fbbc63a8eed89381f6d797399cd98f0067098b9d
MD5 3d477d10c62c1e6a1157ee97b92288ea
BLAKE2b-256 5fdb8237b309e2a9e6a79cadff4762260bfe6f9acfd7e8d9d7afd18273287c6f

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonata_rs-0.1.2-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.2-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for jsonata_rs-0.1.2-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 528ca76af85ffcbb27300fefd736471e3b69e910063e5830fc16616987407ad0
MD5 62ef527dc098f42e706390f1ce0fea7d
BLAKE2b-256 815abbbac29a1699654778b4793660c5bf6f482b5ad0ab76e3307f47811d87c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonata_rs-0.1.2-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.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for jsonata_rs-0.1.2-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dc1b5abf1610bc12b484cb5146057f21eb3bda1ab3a61a7a682c46142af1dcdd
MD5 fba540fbd96d66f5cf7d0cbb885f83d6
BLAKE2b-256 cdf89794c265bd6b1066e374d9f80f38e4c1cb01cf0e63e812669606abf2a702

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonata_rs-0.1.2-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.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for jsonata_rs-0.1.2-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 cdff7228f64ddc0be87e9bc2af9dba34683044a3ef62870fc745799da35d98a5
MD5 c39b004b460bbacf807df627c9dae2ad
BLAKE2b-256 bfe382b574178efc17b7987379dc7ae43e3847daca352d92d0bd27b09c76fac7

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonata_rs-0.1.2-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.2-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jsonata_rs-0.1.2-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2a49a2744d5a94fa70443e5efe9daf909d450b069e93f446f9b0f295376441b4
MD5 a5e1c337724a018bec8d9e8e65c54ec6
BLAKE2b-256 bebb4ef8dc64d685297f431d97d1e406a1fe2724997ab3284fe6bafa79ddc151

See more details on using hashes here.

Provenance

The following attestation bundles were made for jsonata_rs-0.1.2-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.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page