sniff_csv

getml.database.sniff_csv(name, fnames, header=True, num_lines_sniffed=1000, quotechar='"', sep=',', skip=0)

Sniffs a list of CSV files.

Parameters
  • name (str) – Name of the table in which the data is to be inserted.

  • fnames (List[str]) – The list of CSV file names to be read.

  • header (bool, optional) – Whether the CSV file contains a header with the column names. Default to True.

  • quotechar (str, optional) – The character used to wrap strings. Default:

  • sep (str, optional) – The separator used for separating fields. Default:,

  • skip (int, optional) – Number of lines to skip at the beginning of each file (Default: 0). If header is True, the lines will be skipped before the header.

Returns

Appropriate CREATE TABLE statement.

Return type

str