No matching definitions.

frame/csv

src/frame/csv.tur
defn

read-csv-string

(read-csv-string [src :cstr delim :int quote :int has-header :int infer-rows :int null-str :cstr] :int)

parse a CSV blob from memory into a frame.

src:cstr NUL-terminated CSV text
delim:int field separator codepoint (0 = ',')
quote:int quote character codepoint (0 = '"')
has-header:int 0 or 1
infer-rows:int rows to scan for type inference (0 = 100)
null-str:cstr cell value treated as null (pass "" for default)

:int frame handle, or 0 on parse failure / OOM. Free with frame-free.

Since: FR3

defn

read-csv

(read-csv [path :cstr delim :int quote :int has-header :int infer-rows :int null-str :cstr] :int)
defn

read-csv-typed

(read-csv-typed [src :cstr s :int delim :int quote :int has-header :int null-str :cstr] :int)

parse a CSV blob with an explicit schema (skips inference).

Since: FR3

defn

write-csv-string

(write-csv-string [f :int delim :int quote :int has-header :int] :cstr)

render the frame as a CSV cstr (caller frees with the

f:int frame
delim:int separator (0 = ',')
quote:int quote char (0 = '"')
has-header:int 0 or 1

:cstr newly-allocated NUL-terminated buffer.

Since: FR3

defn

write-csv

(write-csv [f :int path :cstr delim :int quote :int has-header :int] :int)

render a frame as CSV and write to `path`.

Internal definitions
__c-nil
__c-cons
__csv-parse-string-- parse a NUL-terminated CSV blob into a __csv_table.
__csv-table-rows-- number of data rows in a parsed table.
__csv-table-cols-- number of columns in a parsed table.
__csv-table-cell-- cell at (row, col); empty cells return "".
__csv-table-header-- header for column c, or "col_N" if no header row.
__csv-table-free-- release a parsed table.
__csv-is-null?-- true for empty, null-str match, NA/NaN/NULL (case-insensitive).
__csv-try-int64-- parse s as int64; returns 1 if successful, 0 otherwise.
__csv-parse-int64
__csv-try-float64
__csv-parse-float64
__csv-try-bool
__csv-parse-bool
__csv-try-date32-- match strict "YYYY-MM-DD" (10 chars, all digits/dashes).
__csv-parse-date32-- "YYYY-MM-DD" -> days since 1970-01-01 (Howard
__csv-try-timestamp-- match "YYYY-MM-DD HH:MM:SS" (19 chars) or with 'T'.
__csv-parse-timestamp-- "YYYY-MM-DD HH:MM:SS" -> microseconds since epoch.
__csv-infer-col-type-- infer the narrowest type for column c by scanning
__csv-append-cell
__csv-fill-builder
__csv-storage-tag
__csv-retag
__csv-build-cols
__csv-build-fields
__csv-build-types
__csv-build-types-from-schema
__field-type-at
__nth-int
__slurp-- read CSV from a file path. Same options as read-csv-string.
__cstr-free
__cstr-null?
__write-file