Skip to main content
Version: Next

Python SDK overview

Experimental — breaking changes may land in any release

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​

AreaCapabilityPage
InstallWheels, source builds, version pinningInstall and wheels
BuildPipeline chaining: from_iter, from_kafka, from_http, sql, map_batches, embedding, llm, sinksPipeline builder
Runrun, take, collect, iter_batches, start_backgroundExecution lifecycle
DataArrow batches, dict ingestion, Polars/DuckDB interopUDF and Arrow
StateEphemeral, local durable, S3 WALState and recovery
FailuresError hierarchy and recoveryErrors
ProductionExport YAML and move to arkflow-serverGraduation to server
BoundariesKnown limitations and experimental statusLimitations

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.