Table.download

Table.download(path=os.cwd(), *, format='csv', overwrite=False, progress=True) → list(str)

Downloads the table in a given format to the path specified, as one or more files. Returns a list of strings representing the absolute file path of all downloaded files.

Parameters:

path : str The path at which to download the table. Will automatically create any directories if they don't exist. If not specified, path defaults to the current working directory.

Some exports (avro and parquet) of larger tables can contain multiple files. The downloaded file paths will vary based on the following rules:

  • If the export has one file, and path is a file (either existing, or ends with an extension), the export will be saved as path.

  • If the export has one file, and path is a directory, the export will be saved within the directory as {table_name}.{format}

  • If the export has multiple files, and path is a file (either existing, or ends with an extension), an exception will be raised.

  • If the export has multiple files, and path is a directory, a subdirectory (based on the table name) will be created and the individual files will be stored within that directory.

format : str, default 'csv' The format of the downloaded file(s). Must be one of csv, parquet, avro, ndjson, sav, sas7bdat, dta

overwrite : bool, default False Whether to overwrite any existing files when downloading. If False, will throw an error if a file with the same name already exists at the provided path.

progress : bool, default True Whether to show progress bar.

Returns:

list<str>

A list of strings represent the absolute paths of the downloaded files.

Last updated