Skip to main content

High-performance Python implementation of JSONata query and transformation language

Project description

jsonatapy

High-performance Python implementation of JSONata - the JSON query and transformation language.

PyPI version Python versions License: MIT

Overview

jsonatapy is a Rust-based Python extension implementing JSONata directly in Rust for native performance.

  • Full JSONata 2.1.0 Support - 1258/1258 reference tests passing
  • Native Python API - Type hints, zero JavaScript dependencies
  • Cross-Platform - Linux, macOS (Intel & ARM), Windows
  • Production Ready - Comprehensive test suite and error handling

Installation

pip install jsonatapy

Supports Python 3.10, 3.11, 3.12, 3.13 on all major platforms.

Quick Start

import jsonatapy

# Simple query
data = {"name": "World"}
result = jsonatapy.evaluate('"Hello, " & name', data)
print(result)  # "Hello, World"

# Compile once, reuse many times
expr = jsonatapy.compile("orders[price > 100].product")
result = expr.evaluate(data)

# Complex transformation
data = {
    "orders": [
        {"product": "Laptop", "quantity": 2, "price": 1200},
        {"product": "Mouse", "quantity": 5, "price": 25},
        {"product": "Keyboard", "quantity": 3, "price": 75}
    ]
}

result = jsonatapy.evaluate("$sum(orders.(quantity * price))", data)
print(result)  # 2750

What is JSONata?

JSONata is a query and transformation language for JSON:

  • Query - Extract data: person.name
  • Filter - Select items: products[price > 50]
  • Transform - Reshape data: items.{"name": title, "cost": price}
  • Aggregate - Calculate: $sum(orders.total)
  • Conditionals - Logic: price > 100 ? "expensive" : "affordable"

See official JSONata docs for language reference.

Features

JSONata 2.1.0 Specification

  • Path expressions and queries
  • Array filtering and mapping
  • Lambda functions and higher-order functions
  • Object construction and transformation
  • Built-in functions (string, numeric, array, object)
  • Conditional expressions

Python API

# One-off evaluation
result = jsonatapy.evaluate(expression, data)

# Compiled expressions (faster for repeated use)
expr = jsonatapy.compile(expression)
result = expr.evaluate(data)

# Check version
print(jsonatapy.__version__)  # 2.1.0

Documentation

Use Cases

  • API response transformation
  • ETL pipelines and data processing
  • Configuration file processing
  • Data filtering and aggregation

Building from Source

# Install Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install maturin
pip install maturin

# Build and install
git clone https://github.com/txjmb/jsonatapy.git
cd jsonatapy
maturin develop --release

See Building Guide for details.

Testing

# Install dependencies
uv pip install --system pytest pytest-xdist

# Run tests
pytest tests/python/ -v

Contributing

Contributions welcome! See CLAUDE.MD for architecture guidelines.

License

MIT License - See LICENSE for details.

This project implements the JSONata specification. JSONata and the reference implementation jsonata-js are also MIT licensed.

Acknowledgments

  • JSONata team for the specification and reference implementation
  • Rust and PyO3 communities

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

jsonatapy-2.1.0.tar.gz (17.3 MB view details)

Uploaded Source

Built Distributions

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

jsonatapy-2.1.0-cp313-cp313-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.13Windows x86-64

jsonatapy-2.1.0-cp313-cp313-manylinux_2_34_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.34+ x86-64

jsonatapy-2.1.0-cp313-cp313-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

jsonatapy-2.1.0-cp313-cp313-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13macOS 10.12+ x86-64

jsonatapy-2.1.0-cp312-cp312-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.12Windows x86-64

jsonatapy-2.1.0-cp312-cp312-manylinux_2_34_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

jsonatapy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

jsonatapy-2.1.0-cp312-cp312-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

jsonatapy-2.1.0-cp311-cp311-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.11Windows x86-64

jsonatapy-2.1.0-cp311-cp311-manylinux_2_34_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

jsonatapy-2.1.0-cp311-cp311-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

jsonatapy-2.1.0-cp311-cp311-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

jsonatapy-2.1.0-cp310-cp310-win_amd64.whl (1.1 MB view details)

Uploaded CPython 3.10Windows x86-64

jsonatapy-2.1.0-cp310-cp310-manylinux_2_34_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

jsonatapy-2.1.0-cp310-cp310-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

jsonatapy-2.1.0-cp310-cp310-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10macOS 10.12+ x86-64

jsonatapy-2.1.0-cp39-cp39-macosx_11_0_arm64.whl (1.0 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

jsonatapy-2.1.0-cp39-cp39-macosx_10_12_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9macOS 10.12+ x86-64

File details

Details for the file jsonatapy-2.1.0.tar.gz.

File metadata

  • Download URL: jsonatapy-2.1.0.tar.gz
  • Upload date:
  • Size: 17.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.11.5

File hashes

Hashes for jsonatapy-2.1.0.tar.gz
Algorithm Hash digest
SHA256 58010c4754f3092472582f9cb8d0a065be1c83f74f134a445e5580e3ddb2f308
MD5 221bc987ef75943f1c1691c8349fc340
BLAKE2b-256 10e5af49d36b7ac0200d7b57d7841acef75feefcb253c2ed409f8a0d1a28c762

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: jsonatapy-2.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for jsonatapy-2.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 c38f4c7c877f996e25e1c6af6577346f8c0e7d6056391ec654ee831c229ae04d
MD5 e1b4b8baec02fa0e9058d9a13d23140f
BLAKE2b-256 add3e0e8e20966cb6a14d14264c44ac210333c4d001bc94f067a5f88672f07de

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp313-cp313-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp313-cp313-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 0399e4e3c175ddee55291e09c5d6030cee12d435471eff068e0cdd77cd25a8d5
MD5 30eda6b5d085c7e92b02f997fe366331
BLAKE2b-256 55b3a18ae88449a30e59b797589848027781812ba908f5189eb88d4db32f4af4

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 83c3a092d8bece024623e0a8900f852aefef16565428f29d3ad2664ecf1250f2
MD5 69bc0aa13696d2babad60a1d84aed355
BLAKE2b-256 a57aff0e7e3809569a7a49c8bcf0e7bffc92ade1e861c31e89a85ce878485b3d

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp313-cp313-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp313-cp313-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ac3fcf2942ffd14fc2c1f9e23176787e16281e9da76b4504d8b2d5a23be646e0
MD5 e35f178ea4c9b94d394e6d1bef47c5a9
BLAKE2b-256 71ae400d748d46efdaf573f172653d93fcbdc31764a6c3a96553d11d35af8579

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: jsonatapy-2.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for jsonatapy-2.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1efd52e3b5a3da085343c97918898e6dd4b5285773e3f989e60bd8bdae84901a
MD5 ccb8e611055eacf83d74038eebb0eea3
BLAKE2b-256 3f3c0dc84916aa6e08a53afb43f98d5bc0ebde34c56ed5d1677a32bc33fa3ca9

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1ed2c5f359faabbafea5120091f14d44627c43c7b06292cf28202d0b2c3c74ed
MD5 e32070ed76108d24bb295cc27b67d242
BLAKE2b-256 e9aec2e1c3a544318568b449eae6623081037768c36f30033bd50c1ce14a4b67

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 caf09d27a9b310837652fd2219516bab2a37f930973a5bcd3c8530e3d4d5bfe5
MD5 27f5602bec3da973a018d4b8a8badd0f
BLAKE2b-256 dcd717982f5578097cb22ff3a3bb4c373a14ab5cc62aa7ce916b0ac486a055e8

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ed5e20a8e9ea8f89dce1e678ffc0c9547d93f615a7c6dfb8889d267f9c2a79f1
MD5 7221eddc1392e8ced4603a68afaf0030
BLAKE2b-256 adc6ece46b4ca8c5802589aad7cf2aa1675144a7042200c475fb6488bc0d4f40

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: jsonatapy-2.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for jsonatapy-2.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 37499f40b58c44999add68b09600e028f99879a9da907b3e73f088f6341151e2
MD5 4505c243ef97a80eee0706628804f418
BLAKE2b-256 800a1faae173fefb98d6b05362c4d24022d369b0fc69ce8e1edba55597a946e2

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1acb2acaa39dec11052e96c6a8b21c911674e0f3f562fe8cde4694189e87af6d
MD5 380fd40009e139053438ed32ea9e4981
BLAKE2b-256 e137e8aa2908cc10ffd8cbd834124effd50b74a1dce296603ddac8c2b32aa2b3

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 020fe2fecc1014433906a9d34c843e48a7d375a0be20336170c1b06a89460faa
MD5 08a391d7775d35e4b60d210c3071c658
BLAKE2b-256 7dcbebce35188c43ed57b98b91b05f98c09ab3efd85f039d2db345cd78f57d33

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 b8e174f2fff6bde960c7491d13570ea0cd4180bfeedb9ddf146533fcd3c6e8de
MD5 5511cb6a8d8e3d53756dba5349c7de92
BLAKE2b-256 271dc2634deb3c023de7041484a93b8a271b48b2dca5f3e8df92d81e40e60d3f

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: jsonatapy-2.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.6

File hashes

Hashes for jsonatapy-2.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 8c28116a5d32846c13ceb20796709d566dd954c00928e91bdb128eb91ecebc69
MD5 063f8d1acb244e30d20d8e34357a8d97
BLAKE2b-256 aa464a8053af8b05155a59a943cd92f70d01cc7357f43ade5c760d69fef4dfde

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 79878ad7b8e32a95c888aca12026b8294bd91a850212a43d035c2464b137c3b5
MD5 7cfcab3e77a4016855236779bcac0064
BLAKE2b-256 8a3b85810783ecb02b606127a9401fe60bbfbb2eba04ee0270cfc40f31f37e4b

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 13225d7ffd605bbe534f27adb5a544bf4cf9a4101f046c422545090461cbd8c6
MD5 1c92a8ac23b618110f9e972a96a23d1f
BLAKE2b-256 97ed8e91eaffe20ac65180244dab51c8d03293d2c6a362267cd34bd0ac6779e5

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp310-cp310-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp310-cp310-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 861b7ad0c53fa1dd63c5c84f7aa7fe28bc137e1adb5e447768f81aa1f2ae65d9
MD5 8fc8c8ff86d0fbc0c464fb29163627b1
BLAKE2b-256 6fdd17d534b24b207b4198e3e672040e8d0e4d8893f796d6f0eaa6ec1d138592

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 051f993027613253680fca1c91f7aa53032bac48eec849a9447726971a527a3c
MD5 8d1d3ea1d6cd235dfbce4739ab47cf15
BLAKE2b-256 cd5f5443e73589c75afadd47eccbde978ea018fbe568cdb6e49048f93c02ef13

See more details on using hashes here.

File details

Details for the file jsonatapy-2.1.0-cp39-cp39-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for jsonatapy-2.1.0-cp39-cp39-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 aa91749142ceae72b463bb2f71feb58b4534b57e4b3d11fee8ccda69c7e5a1c2
MD5 9a2dbe713bf01cad2f3b10a854081408
BLAKE2b-256 365c7104bd98217a76cdf59d98c84734487cb666c4dd7f1de94ebdeb96201a40

See more details on using hashes here.

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