Skip to content

csv

CSV Input filter for ingest_json.

Returns CSV rows as a list. Values will always be strings (no type inference or coercion is performed).

Configuration values:

  • rows (default: dict): type of elements in the result list:
    • dict: elements will be dictionaries, with the keys taken from the header-row.
    • list: each resulting row will be an array values.
  • header-row (default: 0): if rows is dict, the (0-based) index of the header row. All rows before the header row will be skipped.
  • skip-rows (default: 0): number of rows to skip at the beginning of the file (apart from the header and pre-header ones if rows is dict).
  • delimiter (default: ,): field separator character
  • quotechar (default: "): char used to quote (enclose) field values
  • skip-empty-rows (default: True): whether to omit empty rows (i.e., those with no values) from the result
  • trim-values (default: False): whether to apply .strip() to the resulting values
  • charset (default: utf-8): specific charset to use when opening the file