tabsdata.LocalFileDestination#

class LocalFileDestination(path: str | list[str], format: str | FileFormat = None)[source]#

Bases: DestinationPlugin

__init__(path: str | list[str], format: str | FileFormat = None)[source]#

Initializes the LocalFileDestination with the given path; and optionally a format.

Parameters:
  • path (str | list[str]) – The path where the files must be stored. It can be a single path or a list of paths.

  • format (str | FileFormat, optional) – The format of the file. If not provided, it will be inferred from the file extension of the data. Can be either a string with the format or a FileFormat object. Currently supported formats are ‘csv’, ‘parquet’, ‘ndjson’ and ‘jsonl’.

Raises:
  • OutputConfigurationError

  • FormatConfigurationError

Methods

__init__(path[, format])

Initializes the LocalFileDestination with the given path; and optionally a format.

chunk(working_dir, *results)

Trigger the exporting of the data to local parquet chunks. This method will

stream(working_dir, *results)

Trigger the exporting of the data. This method will receive the resulting data

write(files)

Given a file or a list of files, write to the desired destination. Note: this

Attributes

allow_fragments

Whether to allow fragments in the output.

format

The format of the file or files.

path

The path or paths to store the files.