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.3.tar.gz (435.8 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.3-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.3-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.3-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.3-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.3-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.3.tar.gz.

File metadata

  • Download URL: jsonata_rs-0.1.3.tar.gz
  • Upload date:
  • Size: 435.8 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.3.tar.gz
Algorithm Hash digest
SHA256 02058c468d72bd017ce5ad195d31e813e29ba44d56bcabbea94bd36ab1b70cdd
MD5 cb5641639a3bb6512dd07bdf9604dafc
BLAKE2b-256 b950f2c6a3d71691cc8c2b9cc040c2a681541d36ba32727e89e031a65458a965

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.3-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 70007e507550f7e9fd52081edb5fcd3479c9f8efdcde121ab766df629911cff7
MD5 314cb47d563a224ae9247fd440f03214
BLAKE2b-256 e3d9d79b09118d628d9e4d0344132828d2ac36cf945c61e028e4cc1e839d36cb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.3-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7516ef3258ecb3602f037a9c92e087803d24e082ad02b5aa2b45be1e34f43343
MD5 d824f8793c9edab04144d13470122f9f
BLAKE2b-256 788cb80b9e33c9c00fa85c205a16685fe634f0a7fce97c347c672f280090ff59

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.3-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 27d3d72e4feea660a0238aa7112b6d6af9d596be698ec19c79bb547efac172c6
MD5 63143ea15d2ed61d972395101c229739
BLAKE2b-256 88a4d640cf17d91b4ecd85233ec218345baae55e49169379fd6e7736da79d846

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.3-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ef7ca86c482020eb047d45bdb7235795451fa415aebae0d9e5d266f717d7f497
MD5 402cdc7d2c8cc12442db85ab6cfe47a7
BLAKE2b-256 9b5b7ff387afedbbe92ff8a3646b159a46bb0b1884b4eba64c65d443f0be3057

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for jsonata_rs-0.1.3-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0ca2febe4f9821d3f8421a3d985ce4c6e5fd02b5911cbc32a9ef41a9c23e8bbb
MD5 3828f0a12209aeaa9fa0dd3de7cc367f
BLAKE2b-256 d0b6b894f65cff589d9abc1a8d194fa074a4ad3430b19678db4f0e6513957d6d

See more details on using hashes here.

Provenance

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