SagaSaga
SagaCsv

SagaCsv

Types

Config

record Config {
  separator: String,
  skip_header: Bool,
  headers: List String
}

Functions

reader

fun reader : Unit -> Config

writer

fun writer : Unit -> Config

with_separator

fun with_separator : String -> Config -> Config

skip_header

fun skip_header : Config -> Config

with_headers

fun with_headers : List String -> Config -> Config

parse

fun parse : String -> Config -> List (List String)

Parse CSV data into a list of rows, where each row is a list of strings.

parse_keyed

fun parse_keyed : String -> Config -> List (Dict String String)

Parse CSV data into a list of dicts, using the first row as header keys. Panics if the input has no rows.

write

fun write : List (List String) -> Config -> String

Write rows to CSV string.

write_keyed

fun write_keyed : List (Dict String String) -> Config -> String

Write a list of dicts to CSV string. Requires headers to determine column order. Panics if no headers are set.