gws.lib.csv

Common csv writer helper.

Source code: gws.lib.csv

Package Contents

class gws.lib.csv.Config(*args, **kwargs)

Bases: gws.Config

CSV format settings

delimiter: str = ','

field delimiter

encoding: str = 'utf8'

encoding for CSV files

formulaHack: bool = True

prepend numeric strings with an equal sign

quote: str = '"'

quote sign

quoteAll: bool = False

quote all fields

rowDelimiter: str = '\n'

row delimiter

class gws.lib.csv.Object

Bases: gws.Node

Configurable GWS object.

delimiter: str

field delimiter

encoding: str

encoding for CSV files

formulaHack: bool

prepend numeric strings with an equal sign

quote: str

quote sign

quoteAll: bool

quote all fields

rowDelimiter: str

row delimiter

configure()

Configures the Objects attributes with the given config.

writer(locale_uid: str | None = None)

Creates a _Writer object.

Parameters:

locale_uid – Identifier for the local place.

Returns:

A _Writer object.