Metadata-Version: 2.4
Name: ray-klein
Version: 0.1.0a1
Summary: Stateful stream processing for Ray
Author: Klein Authors
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/yuchen-ecnu/klein
Project-URL: Documentation, https://yuchen-ecnu.github.io/klein/
Project-URL: Repository, https://github.com/yuchen-ecnu/klein.git
Project-URL: Issues, https://github.com/yuchen-ecnu/klein/issues
Project-URL: Changelog, https://github.com/yuchen-ecnu/klein/blob/main/CHANGELOG.md
Keywords: ray,stream-processing,batch-processing,data,distributed-computing
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Distributed Computing
Requires-Python: <3.13,>=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
License-File: NOTICE
License-File: THIRD_PARTY_NOTICES
License-File: LICENSES/Apache-2.0.txt
License-File: LICENSES/BSD-3-Clause.txt
License-File: LICENSES/ISC.txt
License-File: LICENSES/MIT.txt
Requires-Dist: click>=8.3.3
Requires-Dist: fsspec==2026.7.0
Requires-Dist: numpy<3,>=1.24; python_version < "3.12"
Requires-Dist: numpy<3,>=1.26.2; python_version >= "3.12"
Requires-Dist: pandas<3,>=2.2.3
Requires-Dist: pyarrow>=23.0.1
Requires-Dist: protobuf<8,>=5.29.6
Requires-Dist: PyYAML>=6; python_version < "3.12"
Requires-Dist: PyYAML>=6.0.1; python_version >= "3.12"
Requires-Dist: ray[data]<2.57,>=2.56.1
Requires-Dist: rich>=13.9.4
Requires-Dist: sqlglot<31,>=30.12
Provides-Extra: kafka
Requires-Dist: confluent-kafka<3,>=2.3; extra == "kafka"
Provides-Extra: iceberg
Requires-Dist: pyiceberg<0.12,>=0.11.1; extra == "iceberg"
Provides-Extra: media
Requires-Dist: Pillow<13,>=12.3.0; extra == "media"
Requires-Dist: pypdf<7,>=6.19.0; extra == "media"
Requires-Dist: pypdfium2<6,>=4.30; extra == "media"
Requires-Dist: pyvips[binary]<4,>=3; extra == "media"
Provides-Extra: rocketmq
Requires-Dist: rocketmq-client-python==2.0.0; extra == "rocketmq"
Provides-Extra: redis
Requires-Dist: redis<9,>=5; extra == "redis"
Provides-Extra: rocksdb
Requires-Dist: rocksdict<0.4,>=0.3.29; extra == "rocksdb"
Provides-Extra: serve
Requires-Dist: httpx<1,>=0.28.1; extra == "serve"
Requires-Dist: orjson>=3.11.6; extra == "serve"
Requires-Dist: ray[serve]<2.57,>=2.56.1; extra == "serve"
Provides-Extra: all
Requires-Dist: confluent-kafka<3,>=2.3; extra == "all"
Requires-Dist: httpx<1,>=0.28.1; extra == "all"
Requires-Dist: orjson>=3.11.6; extra == "all"
Requires-Dist: Pillow<13,>=12.3.0; extra == "all"
Requires-Dist: pyiceberg<0.12,>=0.11.1; extra == "all"
Requires-Dist: pypdf<7,>=6.19.0; extra == "all"
Requires-Dist: pypdfium2<6,>=4.30; extra == "all"
Requires-Dist: pyvips[binary]<4,>=3; extra == "all"
Requires-Dist: ray[serve]<2.57,>=2.56.1; extra == "all"
Requires-Dist: redis<9,>=5; extra == "all"
Requires-Dist: rocksdict<0.4,>=0.3.29; extra == "all"
Requires-Dist: rocketmq-client-python==2.0.0; extra == "all"
Provides-Extra: test
Requires-Dist: babel<3,>=2.13; extra == "test"
Requires-Dist: build<2,>=1.2.1; extra == "test"
Requires-Dist: hypothesis<7,>=6.100; extra == "test"
Requires-Dist: licensecheck<2027,>=2025.1; extra == "test"
Requires-Dist: mypy<3,>=1.11; extra == "test"
Requires-Dist: pip-audit<3,>=2.7; extra == "test"
Requires-Dist: pyiceberg[sql-sqlite]<0.12,>=0.11.1; extra == "test"
Requires-Dist: pytest<10,>=9.0.3; extra == "test"
Requires-Dist: pytest-asyncio<2,>=1.4; extra == "test"
Requires-Dist: pytest-cov<8,>=5; extra == "test"
Requires-Dist: pytest-timeout<3,>=2.3.1; extra == "test"
Requires-Dist: redislite<7,>=6.2.899109; extra == "test"
Requires-Dist: reuse<7,>=5; extra == "test"
Requires-Dist: setuptools<84,>=83; extra == "test"
Requires-Dist: testcontainers[kafka,redis]<5,>=4.13; extra == "test"
Requires-Dist: tomli>=2.4.1; python_version < "3.11" and extra == "test"
Requires-Dist: twine<8,>=5; extra == "test"
Requires-Dist: uv<0.12,>=0.11.31; extra == "test"
Provides-Extra: dev
Requires-Dist: ray-klein[all,docs,test]; extra == "dev"
Requires-Dist: pre-commit>=3.7; extra == "dev"
Requires-Dist: ruff<0.17,>=0.15.22; extra == "dev"
Provides-Extra: docs
Requires-Dist: myst-parser==4.0.1; extra == "docs"
Requires-Dist: pydata-sphinx-theme==0.19.0; extra == "docs"
Requires-Dist: sphinx==8.1.3; extra == "docs"
Requires-Dist: sphinx-copybutton==0.5.2; extra == "docs"
Requires-Dist: sphinx-design==0.6.1; extra == "docs"
Requires-Dist: tomli>=2.4.1; python_version < "3.11" and extra == "docs"
Dynamic: license-file

<!-- SPDX-License-Identifier: Apache-2.0 -->

<p align="center">
  <img src="https://raw.githubusercontent.com/yuchen-ecnu/klein/main/docs/_static/klein-logo.png" alt="Klein" width="440">
</p>

# Stateful stream processing on Ray

Klein is a Python library for continuous data processing on Ray. Build
applications with managed keyed state, event-time windows, and checkpoint
recovery. The `DataStream` and SQL APIs also support bounded data pipelines.

![Events flow through Klein's stateful processing into results, with event time, managed state, and checkpoint recovery.](https://raw.githubusercontent.com/yuchen-ecnu/klein/main/docs/_static/klein-overview.png)

[Documentation](https://yuchen-ecnu.github.io/klein/latest/) ·
[中文文档](https://yuchen-ecnu.github.io/klein/latest/zh_CN/) ·
[GitHub](https://github.com/yuchen-ecnu/klein) ·
[Examples](https://yuchen-ecnu.github.io/klein/latest/examples.html)

## Install

Use Python **3.10–3.12** on Linux or macOS. Klein includes a supported Ray
dependency (`ray[data]>=2.56.1,<2.57`).

```bash
python -m pip install ray-klein==0.1.0a1
```

For Kafka integration:

```bash
python -m pip install "ray-klein[kafka]==0.1.0a1"
```

## Quick start

```python
import ray.klein as klein

pipeline = klein.pipeline(name="quick-start")
rows = (
    pipeline.from_items(
        [
            {"name": "Ada", "amount": 4},
            {"name": "Grace", "amount": 7},
        ]
    )
    .map(lambda row: {**row, "amount": row["amount"] * 2})
    .collect()
    .result()
)

print(rows)
# [{'name': 'Ada', 'amount': 8}, {'name': 'Grace', 'amount': 14}]
```

Continue with the [streaming walkthrough](https://yuchen-ecnu.github.io/klein/latest/getting-started.html)
or [SQL guide](https://yuchen-ecnu.github.io/klein/latest/sql/getting-started.html).

## Capabilities

- Managed value, list, and map state, with timers and TTL.
- Event-time windows, watermarks, and keyed transformations.
- Durable checkpoints and recovery for supported streaming jobs.
- SQL and Table APIs for bounded and continuous queries.
- Connectors for Ray Data, Kafka, filesystems, Iceberg, Redis, and more.
- A Dashboard and CLI for inspecting and operating jobs.

Delivery guarantees depend on the selected source and sink. Review the
[delivery semantics](https://yuchen-ecnu.github.io/klein/latest/delivery-semantics.html)
and [known limitations](https://yuchen-ecnu.github.io/klein/latest/limitations.html)
for your application.

Klein is an independent **alpha** project, not affiliated with or maintained
by Ray. Public APIs and checkpoint formats may change before 1.0.
Released under the [Apache License 2.0](https://github.com/yuchen-ecnu/klein/blob/main/LICENSE).
