baml.csv.WriterOptions$stream

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

Reference version

Signature

class baml.csv.WriterOptions$stream

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 0–0

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

Source:<builtin>/baml/core.bamlbytes 747–779