Python SDK overview
The embedded Python SDK is experimental: the API may change or break in any release until stabilization is announced. Pin your version and read the changelog before upgrading.
pip install arkflow embeds the ArkFlow engine in your Python process: stream
execution on the Tokio + Arrow kernel, zero-copy Arrow PyCapsule interchange
with Polars/DuckDB/PyArrow, optional durable state, and a graduation path to
arkflow-server via YAML export.
Use it when the pipeline is part of a Python application and you do not want a separate process or a cluster. Use the binary when you want a standalone service, multiple sources, or fleet operations.
What is included
| Area | Capability | Page |
|---|---|---|
| Install | Wheels, source builds, version pinning | Install and wheels |
| Build | Pipeline chaining: from_iter, from_kafka, from_http, sql, map_batches, embedding, llm, sinks | Pipeline builder |
| Run | run, take, collect, iter_batches, start_background | Execution lifecycle |
| Data | Arrow batches, dict ingestion, Polars/DuckDB interop | UDF and Arrow |
| State | Ephemeral, local durable, S3 WAL | State and recovery |
| Failures | Error hierarchy and recovery | Errors |
| Production | Export YAML and move to arkflow-server | Graduation to server |
| Boundaries | Known limitations and experimental status | Limitations |
Quickstart
import arkflow
flow = (
arkflow.Pipeline()
.from_iter([
{"user": "a", "amount": 10},
{"user": "b", "amount": 25},
])
.sql("SELECT user, SUM(amount) AS total FROM flow GROUP BY user")
.to_stdout()
)
flow.run() # blocks until end-of-stream (or Ctrl-C)
Expected output: one batch per user with a total column, printed as JSON to
stdout. Pipeline() is ephemeral unless you pass state_path.
Design in one paragraph
The SDK is the same engine as the binary. A Pipeline builds an in-process
YAML-equivalent config, starts the unified execution kernel, and exposes the
output as Arrow batches or a sink. Python callables are registered as
process-local components (py_udf), so they need no plugin build; connector
types still require their cargo feature on the wheel. Importing the package
registers the SDK components once per process and emits the experimental
warning.