Metadata-Version: 2.4
Name: rustevex
Version: 0.0.1
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
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 :: Rust
Classifier: Topic :: Scientific/Engineering
Requires-Dist: numpy>=1.22
Requires-Dist: polars>=0.20 ; extra == 'db'
Requires-Dist: dbtoken ; extra == 'db'
Provides-Extra: db
License-File: LICENSE
Summary: Fast event pattern matching over timestamped token sequences
Keywords: events,pattern-matching,sequences,rust,pyo3
Author-email: Andrew Loza <77357202+ajloza@users.noreply.github.com>
License-Expression: MIT
Requires-Python: >=3.9, <3.13
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://github.com/AJLozaLab/rustevex/tree/main/docs
Project-URL: Homepage, https://github.com/AJLozaLab/rustevex
Project-URL: Issues, https://github.com/AJLozaLab/rustevex/issues
Project-URL: Repository, https://github.com/AJLozaLab/rustevex

# rustevex

Pattern matching over timestamped token sequences. Rust core, Python bindings via PyO3.

## Install

```bash
pip install rustevex
```

From source (needs [Rust](https://rustup.rs) ≥ 1.75):

```bash
pip install maturin
maturin develop --release
```

## Usage

```python
from rustevex import Pattern, EventExpressions

tokens = "A B C".split()
times = [1.0, 3.0, 7.0]

p = Pattern(collector="collect_pairs")
p.add_event("A")
p.add_event("B")
p.add_event("C")
r = EventExpressions(p).match_stream(tokens, times, include_tokens=True)

print(r["m_start"], r["m_end"])           # match span in the stream
print(r["t_start"], r["t_end"])           # match timestamps
print(r["el_stream_idx"], r["el_times"])  # per-element positions / times
print(r["el_tokens"], r["result"])        # tokens and collector output
```

## Docs

- [quickstart](docs/quickstart.md)
- [core concepts](docs/core_concepts.md)
- [collectors](docs/collectors.md) · [dynamic events](docs/dynamic_events.md) · [state machines](docs/state_machines.md)
- [db expressions](docs/db_expressions.md) — query `(id, time, class, text_value, numeric_value)` frames
- [result format](docs/result_format.md) · [preprocessing](docs/preprocessing.md) · [developer guide](docs/developer.md)

Optional db helpers need extra deps: `pip install rustevex[db]`

