isogeo_xml_toolbelt.reporters.csv_reporter module

Sample module to manage CSV reporting

class isogeo_xml_toolbelt.reporters.csv_reporter.CsvReporter(csvpath: pathlib.Path = PosixPath('report.csv'), headers: list = ['header1', 'header2'], extrahead: str = 'ignore')[source]

Bases: object

Produce CSV report. Inherits from standard ‘csv.DictWriter’ lib.

See:
add_multiple(in_data: list)[source]

Add a set of rows to the CSV from the input list of data dictionaries.

Parameters:in_data (list) – list of dictionaries of data to be added. Expected structure: [{header1: valueA}, {header2: valueB}]
add_unique(in_data: dict)[source]

Add a single row to the CSV from the input data dictionary

Parameters:in_data (dict) – Dictionary of data to be added. Expected structure: {header: value}
write_headers()[source]

Write headers to the CSV.