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.1.tar.gz (124.0 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.1-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.1-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.1-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.1-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.1-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.1.tar.gz.

File metadata

  • Download URL: jsonata_rs-0.1.1.tar.gz
  • Upload date:
  • Size: 124.0 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.1.tar.gz
Algorithm Hash digest
SHA256 08a64ac33bed6a1921d0a2d3fe9c6eff12b70f1a95300f1d3afb97246a15c8d3
MD5 8985329b6dee83f0b5e6dcfe0ce0bd16
BLAKE2b-256 ed921290b3b48f3d3c1c88b4277ee3c5a7c0da2e6f82fe939c3f4be23622d77c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.1-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7910785fbef26cd434a4c01981098a7e0d98c9908ef50e47f1a67c845c02d198
MD5 d3f5df7d8c1e14a1150b1b51dac39855
BLAKE2b-256 62119e80675c0fe27818d70fd0c59ad199a4057203a4aa6359c34b748ac37b23

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.1-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 4c37b2f47043e0f6b5502e6e021c92b3c55dce41cabc785e180e543ef190fc45
MD5 c971860b647058fe9e39559ee0c8f9c4
BLAKE2b-256 89ef2762449498ee59600889b6e0cdb7d5401164daf8137813c94837b8ba6f0f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ad134fb5b8348d393a0539c0a946840c273ff4f134e0de2e4a81fed57f28fa89
MD5 6fe65d07e1e10b0f4adbd5d132146bf4
BLAKE2b-256 8cdef274a0c96153117c0090154c4d94deffd7a5f085ac0285484a1111c4f783

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 79c98f2e3389c75895f94e6925a210bbac53f9aed8d508d63048630acdf9dbc2
MD5 05532a9d9155fe11e86e8422378de88f
BLAKE2b-256 18412b951968c3170cc3d189d466b47623c492223ef88e83efae7b1390ed83b7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3422f636d5469d84a6650e09ee3facab171d48863ac12033423c2d16e77814d2
MD5 f64bb14411cdff20d853a237ff1ccaa4
BLAKE2b-256 77b4e3acf9b9b323f6409945036e7538f38a87c497b9b98bb23a5555861e10ff

See more details on using hashes here.

Provenance

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