Beta sign in

Pipe library / csv-digest

csv-digest

Turn a public CSV file into a short text digest.

Utilities

raw.githubusercontent.com

CLI

pipes run examples/csv-digest.pipe.yaml

MCP call

{
  "name": "pipe__csv-digest",
  "arguments": {}
}

Pipe file

examples/csv-digest.pipe.yaml

pipes: 0
name: csv-digest
version: 0.1.0
description: Turn a public CSV file into a short text digest.
permissions:
  network: [raw.githubusercontent.com]
inputs:
  type: object
  properties:
    url:
      type: string
      format: uri
      default: https://raw.githubusercontent.com/plotly/datasets/master/2014_usa_states.csv
    n:
      type: integer
      minimum: 1
      maximum: 30
      default: 8
  required: [url]
outputs:
  type: object
  properties:
    text: { type: string }
    count: { type: integer }
  required: [text, count]
output:
  text: "${steps.format.text}"
  count: "${steps.format.count}"
steps:
  - id: fetch
    block: fetch_http
    with:
      url: "${inputs.url}"
      max_bytes: 500000
    retry: { max: 2, backoff_ms: 400 }
    timeout_ms: 15000
  - id: rows
    block: csv
    in: "${steps.fetch}"
    with:
      mode: parse
      header: true
  - id: capped
    block: limit
    in: "${steps.rows}"
    with: { n: "${inputs.n}" }
  - id: format
    block: format
    in: "${steps.capped}"
    with:
      header: "CSV:\n"
      item_template: "- ${item.State} (${item.Postal})"
      separator: "\n"
  - id: print
    block: emit_stdout
    in: "${steps.format.text}"
    with: { format: text }