commonmind / elm-csv-encode / Csv.Encode

This module provides support for rendering data in csv (comma separateed values) format. The format emitted is as described in [RFC4180][1]. If you want to parse csv files, look at the package periodic/elm-csv; this package is designed to work well with it.


type alias Csv =
{ headers : List String
, records : List (List String) 
}

The Csv type structure. This is the same as the Csv type from periodic/elm-csv.


type alias Settings =
{ alwaysQuoted : Basics.Bool
, delimiter : String 
}

This type is for encode settings. delimiter is the CSV delimiter. If alwaysQuoted is False only those values are quoted that contain a quote character (").

toString : Csv -> String

Convert a Csv to a string.

toStringWith : Settings -> Csv -> String

Convert a Csv to a string with Settings.

toBytes : Csv -> Bytes

Convert a Csv to bytes.

toBytesWith : Settings -> Csv -> Bytes

Convert a Csv to bytes with Settings.

toEncoder : Csv -> Bytes.Encode.Encoder

A bytes encoder for Csvs.