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.1.4.tar.gz (23.1 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.1.4-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyjexl_extended-0.1.4.tar.gz
  • Upload date:
  • Size: 23.1 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.1.4.tar.gz
Algorithm Hash digest
SHA256 e20656f35e5c55b2b4458a5de80c0cd63f6f2e42e7bfccc3ab6e8f2a820fcfc9
MD5 16bddd9e3db6612e31bb6d6f69788ef7
BLAKE2b-256 2e539a35eedcaf24cc360f4eb22c8deeb2b3bf36176c931a1702060dd5d69101

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyjexl_extended-0.1.4.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.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for pyjexl_extended-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 4f1c5cb22201bbf72f379638a8ad812a1353946694ffb21b9c173cf56b3265f9
MD5 3a2bfc49df1705d9e3e6cc64d18c83e3
BLAKE2b-256 b6faa81b0af34d279a2e6310cedc8341ffbabc17eb5f46408e54383f926fb78e

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyjexl_extended-0.1.4-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