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.1.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.1-py3-none-any.whl (18.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyjexl_extended-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 5491eac31fb0bdd891c753d450de6897e6f5d68b8d66e421305927256f50efa2
MD5 60f51bb5f1070f9a9f8bf2a1d4d7b911
BLAKE2b-256 f354ae8598249a27ba2e0203d5d39fe984fb412f1f63191ffaef9ef6d79ebcf5

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyjexl_extended-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 557a4c6f3af2e59a8b61abfb44de1952503869225131e28e671027f8142e757e
MD5 03a9f9606eca8e149b4e2db6c1c050ca
BLAKE2b-256 2652a638040c5fcf0744120f034f239039ed09690977d51b237a669b023c91f0

See more details on using hashes here.

Provenance

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