Different pipes. One standard.

Type to search this site.

Search runs in your browser against a static index built with this site (Pagefind). Nothing you type is sent to a server.

Most pipelines need the same ten steps. They are already written.

Standard pipes

Filter, rename, split, merge, group, convert: the standard library is the plumbing every pipeline needs, addressed as std:<name> and built into the runner. Nothing to install, nothing to lock.

Each pipe below has its own page with its ports, its parameters and an example taken from the pipe's own tests. The exact contract of every pipe is in the standard library specification.

28 pipes in standard library v0.1, read from the specification repository when this site was built. The same list for tools: /std/index.json.

Building an extract–transform–load job? The ETL guide shows how sources, transformations and sinks fit together.

Record transformations #

Change what a record looks like — one record in, one record out: compute, pick, rename and convert its members.

  • Emits the value of a Starlark expression for every item.

    For example: compute a new value from every record.

    in → out

    TransformExperimental
  • Keeps only the listed members of each record.

    For example: keep only the columns a report needs.

    in → out

    TransformExperimental
  • Renames members of each record.

    For example: rename the columns of an export to the names your pipes expect.

    in → out

    TransformExperimental
  • Converts members of each record to a JSON type, exactly or not at all.

    For example: turn the strings of a CSV file into numbers and booleans.

    in → out, rejected

    TransformExperimental

Filtering and counting #

Decide which records go on: by a condition, by position in the stream, or only the first of every key.

  • Keeps the items for which a Starlark expression is truthy.

    For example: drop test accounts before a report.

    in → out, rejected

    TransformExperimental
  • Emits at most the first count items.

    For example: try a pipeline on the first 100 records.

    in → out

    TransformExperimental
  • Discards the first count items.

    For example: skip the first records — a preamble, or a page already read.

    in → out

    TransformExperimental
  • Keeps the first item for every distinct key; bounded by maxKeys.

    For example: remove duplicate webhook deliveries.

    in → out

    TransformExperimental

Routing #

Send records down different branches, and bring branches back into one stream.

  • Routes each item to matched or unmatched by a boolean expression.

    For example: send paid orders one way and unpaid ones another.

    in → matched, unmatched

    TransformExperimental
  • Routes items to one of up to eight outputs by key.

    For example: spread records over up to eight branches by key.

    in → p0, p1, p2, p3, p4, p5, p6, p7

    TransformExperimental
  • Merges several streams into one, interleaved or concatenated.

    For example: combine orders from two shops into one stream.

    in → out

    TransformExperimentalneeds: variadic

Batching #

Turn single records into arrays and arrays back into records — for steps that work on many records per call.

  • Groups consecutive items into JSON arrays of size items.

    For example: group 500 records into one array for a bulk API call.

    in → out

    TransformExperimental
  • Flattens array items into their elements.

    For example: turn arrays back into single records.

    in → out

    TransformExperimental

Windows #

Cut a stream into groups with a meaning — the last five readings, every hundred orders — and pass each group on as one line.

  • Record-count tumbling, sliding and partitioned windows.

    For example: average the last 5 readings, or total per customer.

    in → out

    TransformProposedneeds: windows
  • Draft. Groups items by arrival time. Non-deterministic.

    For example: draft: group whatever arrives within a time span.

    in → out

    TransformProposedneeds: windowsneeds: processing-time-windows

Format conversion #

Move between text, records and Arrow, and check records against a schema. Conversions that can lose information are always explicit nodes.

  • Parses NDJSON text into items.

    For example: read NDJSON text as records.

    in → out

    TransformExperimental
  • Serialises items as NDJSON text.

    For example: hand records to a tool that reads text.

    in → out

    TransformExperimental
  • Parses CSV text into records of strings.

    For example: read a spreadsheet export as records.

    in → out

    TransformExperimental
  • Serialises records as CSV text.

    For example: give a result to someone who wants a CSV file.

    in → out

    TransformExperimental
  • Converts records to Arrow record batches, refusing lossy values.

    For example: hand records to an Arrow-based tool without losing precision.

    in → out

    TransformExperimentalneeds: arrow
  • Converts Arrow record batches to records, refusing lossy values.

    For example: read an Arrow stream as plain records.

    in → out

    TransformExperimentalneeds: arrow
  • Routes items by validity against a JSON Schema.

    For example: stop malformed records before they reach a database.

    in → valid, rejected

    TransformExperimental

Sources and sinks #

Where data enters and leaves a pipeline: standard streams, files and HTTP. The ones that touch files or the network need a grant.

  • Source: the runner's standard input as NDJSON.

    For example: read records piped into the runner.

    no input → out

    ExtractExperimental
  • Sink: the runner's standard output as NDJSON.

    For example: print results for the next shell command.

    in → no output

    LoadExperimental
  • Source: an NDJSON file. Needs a filesystem.read grant covering path.

    For example: start a pipeline from an NDJSON file.

    no input → out

    ExtractExperimental
  • Sink: an NDJSON file. Needs a filesystem.write grant covering path.

    For example: write results to an NDJSON file.

    in → no output

    LoadExperimental
  • Source: NDJSON fetched with one HTTP GET. Needs a network grant for the URL's host:port.

    For example: fetch an NDJSON export over HTTPS.

    no input → out

    ExtractExperimental
  • Sink: consumes and discards its input.

    For example: end a branch whose output you do not need.

    in → no output

    LoadExperimental