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.0.tar.gz (121.7 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.0-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.0-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.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

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

jsonata_rs-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.5 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.17+ ARM64

jsonata_rs-0.1.0-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.0.tar.gz.

File metadata

  • Download URL: jsonata_rs-0.1.0.tar.gz
  • Upload date:
  • Size: 121.7 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.0.tar.gz
Algorithm Hash digest
SHA256 3f68ac393687e3eaf5bf679ae76c19c2eff97baca3bdf13e9ccbdc8fbc29b386
MD5 63d72392da09c40a3dbe71c6029c97ed
BLAKE2b-256 d99ae4ff4ba5e0292e04eda5d24976990ff2f0ed4577efbed974bfd388566d9a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.0-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f7dfe89b486c18fb3f7c349946829fe8f16d6b56207f5c1ad28db6cf9adc2390
MD5 8d7b0f69f32109be981e6e1bd38e030f
BLAKE2b-256 628acee8707b5631f81c1711277f37a11d6f12efbebb4a988f4f800cb4431bde

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.0-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 01b7bd21717a1998cc6667c5aa4f8bb8c8aa997c0e23ec9ad6928c8b1e14444b
MD5 c64ca6ed17babfc245a0908e72dbe66c
BLAKE2b-256 cc05771690da33f6883182c16275d6813dd54e765b77e3a2b9c7f86033e12c62

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ca61f14ee51a3b8005c52b73a138540c067c2eff43156b1c73e458a33c557294
MD5 6197f1d72fb91be9fd98ad3b955ccca9
BLAKE2b-256 944dd62bf7013d0b318409f13bb176dcefa0f1bc80f404dfd301436eadf09a7c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6bba6cfa4b1149f41cd6bc0fdd381e1af601f0d698b8a1425602fba0fbba21b8
MD5 1c658def2c5be9ba507227af8adb5c7c
BLAKE2b-256 202552df0efec98edaedc32209263612b5122c6b942a56ed282e4e1ff060bf35

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0807d0dd91f6617caa557e78a4ed13a0686cba33f5b97ce33628cf494892ece1
MD5 933cc46a1384764aebd21038bdaeef30
BLAKE2b-256 6f27ceb253d48dd541ebde16b2ff178563ff0acd685f3c230eaed56ab2c6dbef

See more details on using hashes here.

Provenance

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