lib.csv.*

Provides

lib.csv.convert(string, digest_type)[source]

Main type conversion function for csv import

Parameters:
  • string (str) – String to be digested

  • digest_type (str) – Name of digetsion function

Return type:

str

Returns:

Converted string

lib.csv.csv_reader(csvfile, dialect)[source]

Generator of str values from csv file in filepath, ignores header

Parameters:
  • csvfile (TextIO) – Csv file to read

  • dialect (Dialect) – Csv dialect

Return type:

Iterable[str]

lib.csv.date(obj)[source]

Makes a date from comparable types

lib.csv.datetime(obj)[source]

Makes a datetime from comparable types

lib.csv.get_header(csvfile, dialect)[source]

Returns list of first line items of file filepath

Parameters:
  • csvfile (TextIO) – CSV file

  • dialect (Dialect) – Dialect of CSV file

Return type:

List[str]

lib.csv.make_object(obj)[source]

Parses the object with ast.literal_eval

lib.csv.sniff(filepath, sniff_size, encoding)[source]

Sniffs CSV dialect and header info

Parameters:
  • filepath (Path) – Path of file to sniff

  • sniff_size (int) – Maximum no. bytes to use for sniffing

  • encoding (str) – File encoding

Return type:

Dialect

Returns:

csv.Dialect object with additional attribute has_header

lib.csv.time(obj)[source]

Makes a time from comparable types