Module Dataset.Csv

Comma separated values.

type fpath = string

The type for filepaths.

type var_names = string list option

The type for variable names.

Decoding

val decode : ?var_names:bool -> ?quote:Stdlib.Char.t -> ?sep:Stdlib.Char.t -> ?file:fpath -> 'o Obs.t -> string -> (var_names * 'o t option, string) Stdlib.result
val read : ?var_names:bool -> ?quote:Stdlib.Char.t -> ?sep:Stdlib.Char.t -> 'o Obs.t -> fpath -> (var_names * 'o t option, string) Stdlib.result
val get : (var_names * 'o t option, string) Stdlib.result -> 'o t

Encoding

val encode : ?var_names:bool -> ?quote:Stdlib.Char.t -> ?sep:Stdlib.Char.t -> 'o t -> string

encode ~var_names ~quote ~sep d encodes the observations of d as comma separated values. If var_names is true (default), the variable names are written on the first line. quote is the character used for quoting values (defaults to '\"'). sep is the character used for separating values (defaults to ',').

val output : ?var_names:bool -> ?quote:Stdlib.Char.t -> ?sep:Stdlib.Char.t -> Stdlib.Out_channel.t -> 'o t -> unit

output oc d is like encode but writes the result on oc.

val write : ?var_names:bool -> ?quote:Stdlib.Char.t -> ?sep:Stdlib.Char.t -> fpath -> 'o t -> (unit, string) Stdlib.result

write is like output but writes the result in file.

Schema

type 'a schema = 'a Var.v list
val schema_of_string : ?force:'a schema -> string -> bool * unit schema
val schema_of_file : ?force:'a schema -> string -> bool * unit Var.v list
val schema_to_ocaml : 'a schema -> string