Metadata-Version: 2.4
Name: jpx
Version: 0.1.0
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing :: General
Requires-Dist: pytest>=8.0 ; extra == 'dev'
Requires-Dist: ruff>=0.8 ; extra == 'dev'
Requires-Dist: mypy>=1.13 ; extra == 'dev'
Provides-Extra: dev
Summary: JMESPath query engine with 460+ functions - Python bindings for jpx-core and jpx-engine
Keywords: jmespath,json,query,transform,filter
Author-email: Josh Rotenberg <joshrotenberg@gmail.com>
License: MIT OR Apache-2.0
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://github.com/joshrotenberg/jpx
Project-URL: Repository, https://github.com/joshrotenberg/jpx

# jpx

Python bindings for [jpx](https://github.com/joshrotenberg/jpx), a JMESPath query
engine with 460+ extended functions on top of the standard JMESPath specification.

The bindings are built in Rust with [PyO3](https://pyo3.rs) and ship as
abi3 wheels, so a single wheel per platform works on CPython 3.9 and newer.

## Install

```bash
pip install jpx
```

## Quick start

```python
import jpx

data = {"people": [{"name": "Alice", "age": 30}, {"name": "Bob", "age": 25}]}

# Run a query
jpx.search("people[?age > `28`].name", data)
# ['Alice']

# Compile once, reuse many times
expr = jpx.compile("people[*].name")
expr.search(data)
# ['Alice', 'Bob']

# Validate an expression without running it
jpx.validate("people[*].name")
# {'valid': True, ...}
```

## Discovering functions

```python
jpx.list_categories()           # extension categories
jpx.list_functions("string")    # functions in a category
jpx.describe("group_by")        # metadata for a single function
```

## Full engine

`JpxEngine` exposes the complete engine: batch evaluation, function
introspection, JSON utilities (diff, patch, merge, stats, paths), and a
session-scoped named query store.

```python
from jpx import JpxEngine

engine = JpxEngine()
engine.evaluate("a.b", {"a": {"b": 1}})
engine.diff({"a": 1}, {"a": 2})        # RFC 6902 patch
engine.stats({"a": [1, 2, 3]})          # structural stats
```

## Links

- Documentation: https://joshrotenberg.github.io/jpx/
- Source and issues: https://github.com/joshrotenberg/jpx

## License

MIT OR Apache-2.0

