Skip to main content

chili

PyPI - Version Visual Studio Marketplace Version PyPI - Version

Chili

A programming language for data analysis and engineering, written in Rust.

Chili uses Polars for data manipulation and Arrow/Parquet for data storage.

Language Syntaxes

Chili provides two language syntaxes:

  • chili — a modern syntax similar to JavaScript.
  • pepper — a vintage syntax similar to q.

Features

  • Polars-powered — full Polars DataFrame support for high-performance data manipulation
  • Arrow / Parquet storage — native support for columnar data formats
  • Partitioned tables — date-partitioned Parquet storage with partition pruning
  • Lazy evaluation — lazy DataFrames with collect for deferred computation
  • IPC / TCP — built-in TCP listener for remote connections
  • Tick / Sub — publish-subscribe infrastructure for real-time data
  • Job scheduler — periodic job execution and memory monitoring
  • Cross-platform — Linux, macOS, and Windows

Installation

pip install chili-pie

From source

cargo build --release --bin chili

Python bindings (chili-sauce)

pip install chili-sauce

Quick Start

Launch the REPL:

# chili syntax (default)
chili

# pepper syntax
chili -P

Evaluate a script:

chili script.chi

Architecture

crates/
├── chili-bin      # CLI binary & REPL
├── chili-core     # Engine state, evaluator, IPC, and built-in functions
├── chili-op       # Data operations (partitioned I/O, scan, eval)
└── chili-parser   # Chumsky-based parser for both syntaxes
Package Description
chili-pie Chili runtime distributed as a Python wheel
chili-sauce Python bindings for EngineState via PyO3

Development

Appending while a snapshot is being written

For a subscriber buffer that is queried or flushed concurrently, use the symbol form of vstack (Pepper syntax):

.s.upd: {[data] vstack[`.s.buf; data]};
.s.flush: {[path; lo; hi]
  window: select from .s.buf where seq > lo, seq <= hi;
  wparquet[path; window; 3]
};

vstack[table_symbol; dataframe] atomically appends chunks and returns the incoming row count. It creates a missing table and follows the existing table's dtypes and timezones, like symbol upsert. A failed append preserves the table. Existing vstack[dataframe; dataframe] calls still return a new dataframe without changing either input.

This append path preserves the old buffers held by snapshots. Ordinary upsert extends the backing storage and may copy the accumulated data when a snapshot is alive. Use vstack consistently for such a buffer: switching back to upsert can rechunk and copy its history.

Each input chunk adds metadata. A snapshot is cheap to create, but the next append may copy chunk descriptors while holding the variable lock. Batch incoming rows where practical. Symbol-form vstack now automatically schedules background compaction: a separate Rust worker starts on the first nonempty append, waits 250 ms between passes, and processes tables changed by vstack. It merges small chunks with a 65,536-row target. No Python timer or job scheduler is required, and compaction does not run on the subscriber's apply thread. Tables changed only by set_var or upsert are not scheduled.

Use .compact.configure[interval_ms; target_rows] (Pepper) or engine.set_auto_compaction(interval_ms=250, target_rows=65536) (Python) to tune the worker. A zero interval disables future passes; a running pass may finish. Python also accepts ChiliEngine(compaction_interval=250, compaction_target_rows=65536). shutdown() stops the worker and waits for any running pass. Configuration after shutdown is rejected.

compact[table_symbol; target_rows] merges adjacent small chunks outside the variable write lock. Already-large chunks keep their buffers, so compacting a small tail does not repeatedly copy a large seeded prefix. The positive row target controls grouping, not a maximum chunk or memory size: groups can exceed the target and the final small group can fall below it. Columns may have different chunk boundaries. compact[dataframe; target_rows] returns a compacted dataframe without changing the input.

The symbol form publishes atomically and returns the compacted snapshot's row count. Concurrent vstack appends are preserved in order after that snapshot. Only one compaction can be pending for the current table state. An explicit compact call reports an error if that table is already being compacted; the automatic worker skips busy tables and retries on a later pass. A drain, replacement, deletion, upsert, upsertn, or other non-vstack mutation invalidates a pending compaction; it returns a cancellation error instead of overwriting newer data. Retry later on the current table. Old snapshots remain valid and retired buffers are released outside the lock.

Retention by assignment, such as .s.buf: neg[.s.keep] # .s.buf, counts as a replacement even though the result is a slice of the same table. It invalidates an in-flight pass and removes the table from the pending compaction queue; a subsequent vstack schedules it again. Frequent replacements can repeatedly cancel compaction, leaving many small chunks and slow readers despite a bounded row count. The worker cannot publish the old prefix after a trim because that could restore rows the application removed.

For periodic bounded retention, upsertn[`.s.buf; 0 # data; .s.keep] appends an empty dataframe with the incoming batch's schema and retains at most .s.keep rows atomically. It also invalidates pending compaction. Its existing extend path merges fragmented numeric columns itself; it does not preserve the background worker's pass. This can copy the retained data while holding the variable write lock, including on the apply thread when called from upd. Choose the retained window and trim frequency against the application's latency budget, especially while snapshots are alive. Keep ordinary incoming appends on vstack when using this pattern.

Tune the interval for the incoming chunk rate. Automatic compaction does not reclaim flushed rows or impose a latency guarantee. A very fragmented buffer can still incur metadata work during concurrent appends and publication. Filtering, compaction, and writing share CPU and memory bandwidth. Coordinate retention with the writer, and advance the flushed sequence only after a successful write under the application's durability policy.

wparquet[path; dataframe; level] honors zstd levels 1–22 and uses the ordered streaming Parquet sink, as Python Polars does. In the pinned Rust Polars 0.55.2 implementation, unset row-group size uses an approximate 122,880-row streaming target. POLARS_IDEAL_SINK_MORSEL_SIZE_ROWS and POLARS_IDEAL_SINK_MORSEL_SIZE_BYTES can override the streaming targets; page size defaults to 1 MiB. Min/max/null-count statistics are enabled, distinct counts are disabled, and encoding selection is automatic. The returned integer is the file size in bytes.

The streaming row target is approximate, not a fixed row-group size. Input chunk layout affects row-group boundaries, file size, and file bytes, even for the same ordered rows and compression level. Automatic compaction changes the live table's chunk layout over time, so separate snapshots of the same logical rows can produce different Parquet bytes. An existing snapshot remains unchanged by later compaction. The sink environment variables adjust targets; they do not select exact row-group sizing, which wparquet does not currently expose. Do not use Parquet file hashes as a test of dataframe equality or expect byte parity with Python Polars. Compare the schema and ordered values for logical equality; exact-byte reproducibility requires controlling physical layout, writer options, and library versions as well.

From 0.11.5, the macOS Python extension uses Rust's system allocator to avoid an allocator-recursion crash reported during engine construction in mixed parallel workloads. Other platforms and the CLI retain mimalloc for Rust allocations. The extension does not replace Python's allocator. The affected macOS parallel suite subsequently passed on 0.11.5.

crates/chili-py/tests/bench_flush.py provides a local synthetic acceptance probe. Run it against a release wheel with NumPy, Polars, and PyArrow installed:

POLARS_MAX_THREADS=1 python crates/chili-py/tests/bench_flush.py writer --rows 8000000 --output tmp/writer.json
POLARS_MAX_THREADS=1 python crates/chili-py/tests/bench_flush.py stall --rows 12550000 --output tmp/stall.json
POLARS_MAX_THREADS=1 python crates/chili-py/tests/bench_flush.py reader --rows 0 --rate 0 --batch-rows 3 --max-frames 2000000 --read-interval 2 --loaded 32 --output tmp/reader.json

The TCP probes verify every received row and record subscriber apply timestamps, append service times, Python progress observations, and publisher gaps separately. JSON results include the environment, parameters, and raw operation timings; adjacent Parquet/NPZ files retain the samples. The native compaction worker is enabled by default; --auto-compaction-ms 0 provides an uncompacted control. For writer fragmentation checks, use --chunks 10000; adding --compact-interval .25 in writer mode compacts each fresh buffer before timing and disables the native worker. In concurrent modes, that option instead uses a separate Python maintenance thread for comparison. Writer preparation time is reported separately and excluded from the writer ratio. These probes use their own corpus and are not a substitute for acceptance runs on the deployment hardware and workload.

Build and test

# Build
cargo build --bin chili

# Test
cargo test

# Clippy
cargo clippy --fix --allow-dirty

# Build & install Python runtime wheel
maturin build --release --out dist --manifest-path crates/chili-bin/Cargo.toml

# Build & install Python bindings
maturin develop --release --manifest-path crates/chili-py/Cargo.toml

A Taskfile is provided for common workflows — run task --list to see all available tasks.

References

  • Polars — an open-source library for data manipulation
  • chumsky — a high-performance parser combinator library
  • kola — source code reused for interfacing with q
  • Nushell — a new type of shell

Thanks to the authors of these projects and all other open-source projects for their great work.

License

MIT

Log synchronization and subscription bounds (0.11.4)

.handle.fsync / Python fsync_handle propagates the first non-interruption sync error without reopening the file. The original descriptor and log lock are preserved. After a writeback failure, durability is unknown; a subsequent successful sync does not establish recovery. Directory durability for file creation/rename is outside this operation.

The bundled tickerplant reply is (log_path; counter; schema; message_end). Replay uses the exclusive message end, independent of stamped row counters. Custom tickerplants should use .broker.subscribeLog[handle; topics; log] or .broker.subscribeFilteredLog[handle; topic; column; values; log], which return (counter; message_end; log_path) atomically with registration. Upgrade both peers together. New subscribers reject legacy three-field replies; old subscribers remain unsafe with stamped counters. Rebuild previously affected subscriber state from retained logs before resuming incremental recovery.

In 0.11.5, log-aware subscription paths are symbols and reach Python as str, restoring the pre-0.11.4 path type. The message-bound handshake is unchanged.

Process-memory reporting is best effort: stats()["process_memory_rss_bytes"] is -1 when the process metrics cannot be initialized or read, and .os.mem reports an error if system information is unavailable. The configured memory monitor logs a warning and stops if initialization fails or the process cannot be found.

.os.mem refreshes system RAM and the current process's RSS. It returns used for that process's RSS, total and avail for total and free system RAM, and limit from CHILI_MEMORY_LIMIT (default 0), all in MiB.

From 0.11.6, the non-macOS Python extension builds mimalloc with local_dynamic_tls so late imports on Linux do not require the loader's spare static TLS block. No early-import rule or GLIBC_TUNABLES setting is required for this allocation path. The CLI keeps its existing allocator configuration. Linux wheel releases are audited for mandatory static-TLS relocations; the manual Linux Python Candidate workflow also runs late-import tests under synthetic TLS pressure on native x86_64 and ARM64 runners.

Metadata

Release files for chili-pie 0.11.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for chili-pie 0.11.7
File Actions
chili_pie-0.11.7-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for chili_pie-0.11.7-py3-none-win_amd64.whl
chili_pie-0.11.7-py3-none-musllinux_1_2_x86_64.whl Python 3 none Linux musl 1.2+ x86-64 Details for chili_pie-0.11.7-py3-none-musllinux_1_2_x86_64.whl
chili_pie-0.11.7-py3-none-musllinux_1_2_aarch64.whl Python 3 none Linux musl 1.2+ ARM64 Details for chili_pie-0.11.7-py3-none-musllinux_1_2_aarch64.whl
chili_pie-0.11.7-py3-none-manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.28+ x86-64 Details for chili_pie-0.11.7-py3-none-manylinux_2_28_x86_64.whl
chili_pie-0.11.7-py3-none-manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.28+ ARM64 Details for chili_pie-0.11.7-py3-none-manylinux_2_28_aarch64.whl
chili_pie-0.11.7-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for chili_pie-0.11.7-py3-none-macosx_11_0_arm64.whl
chili_pie-0.11.7-py3-none-macosx_10_12_x86_64.whl Python 3 none macOS 10.12+ x86-64 Details for chili_pie-0.11.7-py3-none-macosx_10_12_x86_64.whl

Total release size: 208.8 MB

Release files / chili_pie-0.11.7-py3-none-win_amd64.whl

Download URL chili_pie-0.11.7-py3-none-win_amd64.whl
Size 33.3 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
005ffc7b765ac34d9fcffe6697a1fd3be31857de4eae9c1f4483894b8535f6fa
BLAKE2b-256 checksum
How to use checksums
5059061ed731d694934d251fe79e00cafaf5952a7ed203c834d86b6281621dfe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / chili_pie-0.11.7-py3-none-musllinux_1_2_x86_64.whl

Download URL chili_pie-0.11.7-py3-none-musllinux_1_2_x86_64.whl
Size 30.4 MB
Tags Linux musl 1.2+ x86-64 Python 3
SHA-256 checksum
How to use checksums
053ae79c79cb0c83da4c170e6aa6abe8ca54d8020fce3809ecce2beaaa3e55a4
BLAKE2b-256 checksum
How to use checksums
d8e998f528fae43c030e79da0d1015c59e2b7701d9ad771719bc7f8e621f00fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / chili_pie-0.11.7-py3-none-musllinux_1_2_aarch64.whl

Download URL chili_pie-0.11.7-py3-none-musllinux_1_2_aarch64.whl
Size 27.8 MB
Tags Linux musl 1.2+ ARM64 Python 3
SHA-256 checksum
How to use checksums
e20483c0e12d90f40b5689a11e20d47305379828b82307c8dc911b4712bfee9b
BLAKE2b-256 checksum
How to use checksums
6dc1eb99317ad84781c9ab103c311563929ba49a950c93f1874140d9bb837320
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / chili_pie-0.11.7-py3-none-manylinux_2_28_x86_64.whl

Download URL chili_pie-0.11.7-py3-none-manylinux_2_28_x86_64.whl
Size 31.8 MB
Tags Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
36fa2d1d8ad59a5682b43b61455a66ffb9a914bb7d5f6976a9c1cd95e55d8b27
BLAKE2b-256 checksum
How to use checksums
bdb0c1a93e4413a12675c8d0b08f5b8569368e1b97f1837d287939e9a85c9f53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / chili_pie-0.11.7-py3-none-manylinux_2_28_aarch64.whl

Download URL chili_pie-0.11.7-py3-none-manylinux_2_28_aarch64.whl
Size 28.0 MB
Tags Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
5f3314e8ec6e4fb7f459e351853ec0c9d3db70a0df68905c0448b0c308759281
BLAKE2b-256 checksum
How to use checksums
832c4205fd9ac4c0f8a21430ec9549721a3b98875fc07daf40b865d902085068
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / chili_pie-0.11.7-py3-none-macosx_11_0_arm64.whl

Download URL chili_pie-0.11.7-py3-none-macosx_11_0_arm64.whl
Size 27.3 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
68f5eb1c3edc6e681d19a66aab47f842b6ef81b0c72789fdd8f3e1c7587bc79b
BLAKE2b-256 checksum
How to use checksums
86f75fba8bffcd2d1fa08680606d059eae529a55387f214928ea7e601660ffcf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / chili_pie-0.11.7-py3-none-macosx_10_12_x86_64.whl

Download URL chili_pie-0.11.7-py3-none-macosx_10_12_x86_64.whl
Size 30.1 MB
Tags Python 3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
afd5390408b27bae9d1ea38f7887a4e79ac1f96e20622d1a41b72cea13d6bdb2
BLAKE2b-256 checksum
How to use checksums
60d3452fa618d3c8267a89c1fd373d3e453f82e820d71a5405686b90c8999e12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.9 {"installer":{"name":"uv","version":"0.13.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for chili-pie 0.11.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.11.7 This release

7 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page