baml.csv.WriterOptions

Options for CSV writers. All fields are optional; `null` means default.

Reference version

Signature

class baml.csv.WriterOptions

Options for CSV writers. All fields are optional; null means default.

As with ReaderOptions, delimiter, quote, and escape must be single ASCII bytes (never CR or LF) and mutually distinct; violations throw Error { kind: Options } when the writer is constructed.

Source:<builtin>/baml/ns_csv/csv.bamlbytes 6620–7880

Fields

delimiter

string | null

Field separator. Exactly one ASCII byte. Default ",".

quote

string | null

Quote character. Exactly one ASCII byte. Default "\"".

quote_style

"minimal" | "all" | "never" | null

"minimal" (default): quote only fields containing the delimiter, quote, CR, or LF. "all": quote every field. "never": quote nothing; a field that would require quoting throws Encode.

escape

string | null

null (default) means "" doubling inside quoted fields.

terminator

"lf" | "crlf" | null

Record terminator. Default "lf"; "crlf" for strict RFC 4180 / Excel.

write_header

bool | null

Automatically emit a header before the first write_row<T>. Default true.

headers

string[] | null

Override header names for typed writes (positional).

null_value

string | null

How null serializes. Default "".

bom

bool | null

Emit a UTF-8 BOM (Excel's UTF-8 detection). Default false.

sanitize_formulas

bool | null

CSV-injection guard: prefix ' to cells starting with =, +, -, @, tab, CR, or LF (including full-width variants). Mutates the data, which is why it is opt-in. Default false.

Implementations

baml.Concrete for T

Static methods

function

type

() -> reflect.Type throws never

This type's runtime type value: int.type() is the same value as reflect.Type.of<int>().

Spell it on a declared type written as one name, optionally qualified or with generic arguments: Foo.type(), root.models.Base.type(), Box<int[]>.type(). Array, optional, union, map and function types, interfaces, and generic type parameters keep the reflect.Type.of<T>() form. A type that declares its own type member keeps resolving to it.

Source:<builtin>/baml/core.bamlbytes 1360–1392