Metadata-Version: 2.4
Name: chili-sauce
Version: 0.9.1
License-File: LICENSE
Summary: Python bindings for the Chili engine (EngineState)
Requires-Python: >=3.10
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM

# Chili Sauce 🌶️

Python bindings for [Chili](https://purple-chili.github.io/)'s `EngineState`, powered by [PyO3](https://pyo3.rs/).

## Installation

```bash
pip install chili-sauce
```

Requires Python ≥ 3.10.

## Quick Start

```python
from chili import ChiliEngine

engine = ChiliEngine()

# Evaluate expressions
engine.eval("1 + 2")  # => 3

# Variable management
engine.set_var("x", 42)
engine.get_var("x")  # => 42

# Work with Polars DataFrames
import polars as pl

df = pl.DataFrame({"a": [1, 2, 3], "b": [4, 5, 6]})
engine.set_var("df", df)
engine.get_var("df")
```

## IPC / Remote Queries

```python
# Open a handle to a remote Chili process
h = engine.open_handle("chili://:1800")

# Send synchronous queries
engine.sync(h, b"1+1")                # bytes  — sent as a raw string query
engine.sync(h, ["set", "a", 2])       # list   — sent as a function call (func, args…)
```

## Features

- **Evaluate** Chili or Pepper expressions from Python
- **Variable management** — get, set, delete, and list variables
- **Polars integration** — pass DataFrames bidirectionally between Python and Chili
- **Partitioned storage** — write and load date-partitioned Parquet tables
- **IPC / TCP** — start a TCP listener for remote connections
- **Tick plant** — built-in pub/sub infrastructure for real-time data

## Type Mapping

| Python type         | Chili type  |
| ------------------- | ----------- |
| `int`               | `Int`       |
| `float`             | `Float`     |
| `bool`              | `Bool`      |
| `str`               | `Symbol`    |
| `bytes`             | `String`    |
| `None`              | `Null`      |
| `list`              | `MixedList` |
| `dict`              | `Dict`      |
| `datetime.date`     | `Date`      |
| `datetime.time`     | `Time`      |
| `datetime.datetime` | `Datetime`  |
| `polars.DataFrame`  | `DataFrame` |

## Development

```bash
# Build and install in development mode
maturin develop --release --manifest-path crates/chili-py/Cargo.toml

# Run tests
pytest crates/chili-py/tests/
```

