csv.Dialect.skipinitialspace

Dialect.skipinitialspace When True, whitespace immediately following the delimiter is ignored. The default is False.

csv.Dialect.strict

Dialect.strict When True, raise exception Error on bad CSV input. The default is False.

csv.DictWriter

class csv.DictWriter(csvfile, fieldnames, restval='', extrasaction='raise', dialect='excel', *args, **kwds) Create an object which operates like a regular writer but maps dictionaries onto output rows. The fieldnames parameter is a sequence of keys that identify the order in which values in the dictionary passed to the writerow() method are written to the csvfile. The optional restval parameter specifies the value to be written if the dictionary is missing a key in fieldnames. If the diction

csv.Error

exception csv.Error Raised by any of the functions when an error is detected.

csv.DictWriter.writeheader()

DictWriter.writeheader() Write a row with the field names (as specified in the constructor). New in version 3.2.

csv.Dialect.delimiter

Dialect.delimiter A one-character string used to separate fields. It defaults to ','.

csv.Dialect.quoting

Dialect.quoting Controls when quotes should be generated by the writer and recognised by the reader. It can take on any of the QUOTE_* constants (see section Module Contents) and defaults to QUOTE_MINIMAL.

csv.Dialect.escapechar

Dialect.escapechar A one-character string used by the writer to escape the delimiter if quoting is set to QUOTE_NONE and the quotechar if doublequote is False. On reading, the escapechar removes any special meaning from the following character. It defaults to None, which disables escaping.

csv.Dialect.doublequote

Dialect.doublequote Controls how instances of quotechar appearing inside a field should themselves be quoted. When True, the character is doubled. When False, the escapechar is used as a prefix to the quotechar. It defaults to True. On output, if doublequote is False and no escapechar is set, Error is raised if a quotechar is found in a field.

csv.Dialect.lineterminator

Dialect.lineterminator The string used to terminate lines produced by the writer. It defaults to '\r\n'. Note The reader is hard-coded to recognise either '\r' or '\n' as end-of-line, and ignores lineterminator. This behavior may change in the future.