Macropipe

Macropipe follows the structured pipeline approach of the Polars pipe operator. It provides text-based macro languages that compile to Polars expressions. See also Macropipe Primer.

Install

uv pip install --upgrade 'macropipe[all]'

Synopsis

Read from data source, apply transformation, and write to data sink.

import polars as pl
from macropipe import MacroPipe

# Define transformation pipeline.
pipeline = MacroPipe.from_recipes("head:30")

# Invoke pipeline and inspect result.
lf = pl.scan_csv("example.csv")
df = lf.mp.apply(pipeline).collect()
print(df)

Usage

Please explore the Examples documentation section, items in the “examples” directory, and the software tests, in order to learn about details or get inspirations that might not have been reflected in the documentation yet.

Prior Art

See Related projects that existed before Macropipe.