summary = df sales |> group_by(region) |> summarize(total = sum(amount)) |> arrange(total)input
output
A language for clean pipelines in Python
Write clean, readable data pipelines as small scripts that run with the Python code and tools you already use.
uv add "pyplyne @ git+https://github.com/pyplyne-org/pyplyne.git"Requires Python 3.13+. Use the Git source install until the PyPI package is published.
summary = df sales |> group_by(region) |> summarize(total = sum(amount)) |> arrange(total)input
output
restock = seq orders |> filter(qty > 1) |> keep_fields(item) |> set_fields(buy = item == "pens")input
output
What it gives you
Pipeline language
Use a small pipeline language for named, left-to-right steps instead of nested function calls or scattered temporary variables.
Two data shapes
Choose the pipeline shape that matches your data: table workflows with df, record-list workflows with seq.
Python runtime
PyPlyne compiles to CPython AST in memory, so imports, objects, and tracebacks stay connected to normal Python.
Run it your way
Write a pipeline file
Start with the simplest workflow: write clean pipeline code, import the Python helpers you already trust, then run it from the command line.
from pathlib import Path
sales = df read_csv(Path("sales.csv"))
summary = sales
|> where(amount > 100)
|> group_by(region)
|> summarize(total = sum(amount))
print(summary)
summaryuv run pyplyne pipeline.pyplyneUse it from Python
Run a short PyPlyne source string in one call, end it with the value you want, and read the live Polars DataFrame from the result.
import polars as pl
from pyplyne import run
sales = pl.DataFrame([
{"region": "north", "amount": 120},
{"region": "south", "amount": 80},
])
result = run("""
summary = df sales
|> where(amount > 100)
|> select(region, amount)
summary
""", context={"sales": sales})
summary = result.result
print(summary)Explore from VS Code
The local VS Code extension gives `.pyplyne` files syntax highlighting, block execution, diagnostics, and a persistent PyPlyne session.
sales = df read_csv("sales.csv")
large_sales = sales
|> where(amount > 100)
|> select(region, amount)
large_salesAgent iteration loop
Keep imports, helpers, and loaded data in one PyPlyne session so an agent can send small snippets, read structured feedback, and keep improving the transformation.
uv run pyplyne serve --port 8765 --load setup.pyplyne
uv run pyplyne send --json <<'PYPLYNE'
summary = df sales
|> group_by(region)
|> summarize(total = sum(amount))
summary
PYPLYNE