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

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.2.tar.gz (21.9 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.2-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyjexl_extended-0.1.2.tar.gz
  • Upload date:
  • Size: 21.9 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.2.tar.gz
Algorithm Hash digest
SHA256 c28f5dbb579a37908e77e17dc98d2949d2f9b511f37c706c8f5bf6811ed58e61
MD5 68fdd4071adead0db6f765b9d1852ec9
BLAKE2b-256 97dd67e8686674baac893c0e15d9b69ff46c05483b08cb6d0dda77ca00ec1006

See more details on using hashes here.

Provenance

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

Publisher: publish-pypi.yml on nikoraes/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.2-py3-none-any.whl.

File metadata

File hashes

Hashes for pyjexl_extended-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b928b1c0ed193620fb343c5f2d6b9199e60292022abf739d815a932e7ee1549b
MD5 393733f02f231adb27efefa0ebd13b3b
BLAKE2b-256 80d68c4232a21926e8c42c94bc2a2fefaa7bca3ce2a489792cfc55d42d3b6ff9

See more details on using hashes here.

Provenance

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

Publisher: publish-pypi.yml on nikoraes/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