Metadata-Version: 2.4
Name: pyjexl-extended
Version: 0.1.2
Summary: A JEXL parser and evaluator with extended grammar (80+ built-in functions and transforms).
Author-email: nikoraes <niko.raes@gmail.com>
License: Copyright (c) 2016 Michael Kelly.
        
        bin/build-package.sh and CI configurations were taken from
        https://github.com/atom/ci and are Copyright (c) 2015 GitHub Inc.
        
        Permission is hereby granted, free of charge, to any person obtaining
        a copy of this software and associated documentation files (the
        "Software"), to deal in the Software without restriction, including
        without limitation the rights to use, copy, modify, merge, publish,
        distribute, sublicense, and/or sell copies of the Software, and to
        permit persons to whom the Software is furnished to do so, subject to
        the following conditions:
        
        The above copyright notice and this permission notice shall be
        included in all copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
        EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
        MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
        NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
        LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
        OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
        WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
        
Project-URL: Homepage, https://github.com/nikoraes/pyjexl-extended
Project-URL: Repository, https://github.com/nikoraes/pyjexl-extended
Project-URL: Playground, https://nikoraes.github.io/jexl-playground/
Keywords: jexl,expression,parser,grammar,extended
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: parsimonious
Requires-Dist: future
Dynamic: license-file


# 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](https://github.com/TomFrost/Jexl) and extends the original [mozilla/pyjexl](https://github.com/mozilla/pyjexl) with a rich set of features inspired by [jexl-extended](https://github.com/nikoraes/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:

```bash
pip install pyjexl-extended
```

Basic usage:

```python
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]|sum` → `6`
- Object: `{foo:1, bar:2}|keys` → `['foo', 'bar']`
- Date: `now()` → ISO datetime string
- Math: `10.123456|round(2)` → `10.12`

See [jexl-extended](https://github.com/nikoraes/jexl-extended) for the full list of available functions and transforms.

## Playground

Try out expressions interactively:
- [JEXL Playground](https://nikoraes.github.io/jexl-playground/)

## Related Projects

- [jexl-extended (TypeScript)](https://github.com/nikoraes/jexl-extended) — The original extended grammar for JEXL
- [JexlNet (C#)](https://github.com/nikoraes/JexlNet) — C# implementation with extended grammar
- [PyJEXL (Mozilla)](https://github.com/mozilla/pyjexl) — Original Python JEXL parser
- [jexl-rs (Rust)](https://github.com/mozilla/jexl-rs) — Rust-based JEXL parser

## License

Licensed under the MIT License. See `LICENSE` for details.
