Skip to main content

A JEXL parser and evaluator with extended grammar (80+ built-in functions and transforms).

Project description

PyJEXL-Extended

Python implementation of the JEXL expression language with extended grammar—over 80 built-in functions and transforms for strings, numbers, arrays, objects, dates, and more.

NOTE: This library is based on TomFrost's JEXL and extends the original mozilla/pyjexl with a rich set of features inspired by jexl-extended.

Features

  • 🚀 80+ Built-in Functions & Transforms: String manipulation, math, arrays, objects, dates, and more
  • 🧩 Modular Grammar: Use the entire library or import individual functions
  • 🐍 Pythonic Semantics: Type-safe, predictable behavior
  • 🧪 Extensible: Add your own functions, transforms, and operators

📚 Full Documentation: https://docs.konnektr.io/docs/jexl/

Quick Start

Install:

pip install pyjexl-extended

Basic usage:

from pyjexl.jexl_extended import JexlExtended

context = {
    "users": [
        {"name": "John", "age": 32},
        {"name": "Jane", "age": 34},
        {"name": "Bob", "age": 33}
    ]
}

jexl = JexlExtended(context)
result = jexl.eval('users|filter("value.age > 32")|map("value.name")|join(", ")')
# "Jane, Bob"

Extended Grammar Examples

  • String: "hello world"|uppercase"HELLO WORLD"
  • Array: [1,2,3]|sum6
  • Object: {foo:1, bar:2}|keys['foo', 'bar']
  • Date: now() → ISO datetime string
  • Math: 10.123456|round(2)10.12

See jexl-extended for the full list of available functions and transforms.

Playground

Try out expressions interactively:

Related Projects

License

Licensed under the MIT License. See LICENSE for details.

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

pyjexl_extended-0.2.2.tar.gz (24.8 kB view details)

Uploaded Source

Built Distribution

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

pyjexl_extended-0.2.2-py3-none-any.whl (18.4 kB view details)

Uploaded Python 3

File details

Details for the file pyjexl_extended-0.2.2.tar.gz.

File metadata

  • Download URL: pyjexl_extended-0.2.2.tar.gz
  • Upload date:
  • Size: 24.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyjexl_extended-0.2.2.tar.gz
Algorithm Hash digest
SHA256 a7ee52b23916e8a7cc7cdf851de15acdf3570dada1b837752e51fdf03dd124c4
MD5 40a9fa3823839e898cc6fe5ea688a947
BLAKE2b-256 23932f60c3b0f5b70e89236c508a6cae66aa0ab13857a66940fc6be93fd414f2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyjexl_extended-0.2.2.tar.gz:

Publisher: publish-pypi.yml on konnektr-io/pyjexl-extended

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyjexl_extended-0.2.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pyjexl_extended-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 224486b3ad896454c37de4c6e9a405679ab95a6cbefc932e3e304d2e7f152a7a
MD5 411684c8c10f67b5ffe189293f4fcc6f
BLAKE2b-256 e548bda372e6d6ce9f67c26eccda0cd9feaf542859020aba366e8ceceee51147

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyjexl_extended-0.2.2-py3-none-any.whl:

Publisher: publish-pypi.yml on konnektr-io/pyjexl-extended

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