Skip to main content
Version: Next

ExportDataCsvKwargs

Keyword arguments forwarded to csv.DictWriter by the CSV export.

Mirrors the keyword arguments of csv.DictWriter, so consult its documentation for their exact meaning. The fieldnames and extrasaction arguments are omitted, because the export derives the columns from the exported items and manages how keys outside them are handled.

Hierarchy

Index

Properties

keyword-onlyoptionaldelimiter

delimiter: NotRequired[str]

A one-character string used to separate fields. Defaults to ','.

keyword-onlyoptionaldialect

dialect: NotRequired[str]

Specifies a dialect to be used in CSV parsing and writing.

keyword-onlyoptionaldoublequote

doublequote: NotRequired[bool]

Controls how instances of quotechar inside a field should be quoted. When True, the character is doubled; when False, the escapechar is used as a prefix. Defaults to True.

keyword-onlyoptionalescapechar

escapechar: NotRequired[str]

A one-character string used to escape the delimiter if quoting is set to QUOTE_NONE and the quotechar if doublequote is False. Defaults to None, disabling escaping.

keyword-onlyoptionallineterminator

lineterminator: NotRequired[str]

The string used to terminate lines produced by the writer. Defaults to '\r\n'.

keyword-onlyoptionalquotechar

quotechar: NotRequired[str]

A one-character string used to quote fields containing special characters, like the delimiter or quotechar, or fields containing new-line characters. Defaults to '"'.

keyword-onlyoptionalquoting

quoting: NotRequired[Literal[0, 1, 2, 3]]

Controls when quotes should be generated by the writer and recognized by the reader. Can take any of the QUOTE_* constants, with a default of QUOTE_MINIMAL.

keyword-onlyoptionalrestval

restval: NotRequired[str]

The value written for columns an item does not contain. Defaults to an empty string.

keyword-onlyoptionalskipinitialspace

skipinitialspace: NotRequired[bool]

When True, spaces immediately following the delimiter are ignored. Defaults to False.

keyword-onlyoptionalstrict

strict: NotRequired[bool]

When True, raises an exception on bad CSV input. Defaults to False.