tlc.core.export.exporters.csv#

Exporter for the CSV format.

Module Contents#

Classes#

Class

Description

CSVExporter

Exporter for the CSV format.

API#

class tlc.core.export.exporters.csv.CSVExporter#

Bases: tlc.core.export.exporter.Exporter

Exporter for the CSV format.

priority = 1#
supported_format = csv#
classmethod can_export(table: tlc.core.objects.table.Table, output_url: tlc.core.url.Url) bool#
classmethod serialize(table: tlc.core.objects.table.Table, output_url: tlc.core.url.Url, weight_threshold: float = 0.0, dialect: str | csv.Dialect | type[csv.Dialect] = 'excel', exclude_header: bool = False, **kwargs: Any) str#

Serialize a table to a CSV string.

Parameters:
  • table – The table to serialize

  • weight_threshold – The minimum weight of a row to be included in the output

  • dialect – The dialect to use for the CSV output. This can be a string like “excel” or “unix”. If you are not using the CLI tool, but are instead using the Python API, you can also pass a Dialect object or a subclass of Dialect.

  • exclude_header – Exclude the header row in the output

Returns:

A CSV string representing the table