mir.csv

CSV/TSV parsing

CsvProxy can be serialized to Ion, JSON, MsgPack, or YAML and then deserialized to a specified type. That approachs allows to use the same mir deserialization pattern like for other data types. $(REF_ALTTEXT $(TT serde), serde, mir, ion, conv)$(NBSP) unifies this two steps throught binary Ion format, which serves as an efficient DOM representation for all other formats.

Members

Aliases

CsvAlgebraic (from mir.algebraic_alias.csv)
alias CsvAlgebraic = Algebraic!Csv_ via public import mir.algebraic_alias.csv : CsvAlgebraic;

Functions

csvToAlgebraicMatrix
Slice!(CsvAlgebraic*, 2) csvToAlgebraicMatrix(string text, char separator, char quote, CsvProxy.Conversion[] conversions, char comment, ubyte skipRows, bool fill, bool skipEmptyLines, bool parseNumbers, bool parseTimestamps, CsvAlgebraic delegate(return scope const(char)[] unquotedString, CsvAlgebraic scalar, bool quoted, size_t columnIndex) @(safe) pure conversionFinalizer)
csvToStringMatrix
Slice!(string*, 2) csvToStringMatrix(string text, char separator, char quote, char comment, ubyte skipRows, bool fill, bool skipEmptyLines)
inclusiveHeader
string[] inclusiveHeader(const(StringMap!T)[] objects)
intersectionHeader
string[] intersectionHeader(const(StringMap!T)[] objects)
matrixAsDataFrame
StringMap!(Slice!(T*, 1, SliceKind.universal)) matrixAsDataFrame(Slice!(T*, 2) matrix)

Represent CSV data as dictionary of columns. Uses the first row as header.

objectsAsRows
auto objectsAsRows(const(StringMap!T)[] objects, const(string)[] header)

Contruct a lazy random-access-range (ndslice)

objectsAsTable
auto objectsAsTable(const(StringMap!T)[] objects, const(string)[] header)
serializeCsv
string serializeCsv(V value, char separator, char quote, bool quoteAll, string naValue, string trueValue, string falseValue, int serdeTarget)

CSV serialization function.

serializeCsv
void serializeCsv(Appender appender, V value, char separator, char quote, bool quoteAll, string naValue, string trueValue, string falseValue, int serdeTarget)

Ion serialization for custom outputt range.

Structs

CsvProxy
struct CsvProxy

A proxy that allows to converty CSV to a table in another data format.

CsvReader
struct CsvReader

Rapid CSV reader represented as a range of rows.

CsvSerializer
struct CsvSerializer(Appender)

Meta