Metadata-Version: 2.4
Name: keyten
Version: 0.1.52
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Topic :: Database :: Database Engines/Servers
License-File: LICENSE
Summary: Python bindings for the Keyten columnar dataframe engine
Keywords: dataframe,columnar,query-engine,analytics
Author: Anton Kundenko
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Documentation, https://k10.works/docs/
Project-URL: GitHub, https://github.com/k10works
Project-URL: Homepage, https://k10.works/

# keyten

Python bindings for [Keyten](https://k10.works/), a compact Rust dataframe engine that keeps columnar data compressed through whole queries.

Queries stay lazy until `collect()`, then run entirely in the engine with the GIL released — predicate and projection pushdown, vectorized parallel execution, disk spilling for data bigger than memory, and native-table I/O all happen outside the interpreter.

## Install

Keyten supports 64-bit Linux, macOS arm64 (Apple Silicon), and CPython 3.11 or newer. See the [installation guide](https://k10.works/docs/install/) for exact wheel tags and source builds.

```bash
pip install keyten
```

## A first query

```python
import keyten as kt

trades = kt.DataFrame([
    kt.Series.string("sym", ["a", "b", "a", "b"]),
    kt.Series.int("qty", [1, 2, 3, 4]),
])

result = (
    trades.lazy()
    .filter(kt.col("qty") > 1)
    .with_columns((kt.col("qty") * 10).alias("q10"))
    .group_by("sym")
    .agg([
        kt.col("q10").sum(),
        kt.col("qty").count().alias("n"),
    ])
    .sort("sym")
    .collect()
)

print(result)
```

## What's in the box

- **Expressions** — arithmetic, comparisons, boolean logic, casts, string operations (substring, regex extract), value recoding, null/NaN shaping, and conditional `if_else`.
- **Aggregations** — totals, extrema, sample moments, exact distinct counts, quantiles, and pairwise correlation, per group or whole-frame.
- **Windows** — cumulative, fixed-row rolling, duration rolling, exponentially weighted, ranking, filling, and partitioned `over(...)` evaluation.
- **Joins** — inner, left, semi, anti, and backward/forward/nearest asof joins with by-groups and tolerance.
- **Mutation** — eager append, upsert, update, and delete; existing lazy plans retain their original snapshot.
- **Temporal kinds** — dates, timestamps, and times are first-class, parse straight from CSV, and ride the integer encodings.
- **Sources** — `scan_csv` (strict typed inference), `scan_parquet` (files or directories, statistics-pruned), and `scan_native`, the engine's own zero-copy, crash-safe table format.
- **Interop** — Arrow PyCapsule import/export with no required Arrow library dependency.
- **Scale** — out-of-core execution against a self-derived memory budget; nothing to configure.
- **Workers** — serializable scans can execute remotely or scatter mergeable aggregation across a worker list.

The package ships typed stubs (`py.typed`), so editors and type checkers see the full API with docstrings.

## Documentation

Tutorials, the full API reference, and engine internals live at [k10.works/docs](https://k10.works/docs/).

## Copyright

Copyright © 2026 Rayforce Technologies Inc. All rights reserved.

