zut.CsvFormat

class zut.CsvFormat(*, encoding: str | None = None, delimiter: str | None = None, decimal_separator: str | None = None, quotechar: str | None = None, nullval: str | None = None, no_headers: bool | None = None, excel: bool | None = None)

Bases: object

  • excel: format CSV so that it may be displayed easily with Excel:
    • Delimiter and decimal separator are chosen depending on the locale.

    • Datetimes are expressed naively (without a timezone), in the local timezone, without microseconds.

    • The file starts with UTF8 BOM, which Excel needs to display accentuated characters correctly.

__init__(*, encoding: str | None = None, delimiter: str | None = None, decimal_separator: str | None = None, quotechar: str | None = None, nullval: str | None = None, no_headers: bool | None = None, excel: bool | None = None)

Methods

__init__(*[, encoding, delimiter, ...])

escape_value(value)

examine_file(file, *[, file_name, ...])

Attributes

decimal_separator

delimiter

encoding

ends_with_newline

excel

first_row

headers

no_headers

nullval

quotechar