Formatters

Formatters will define in what format the data will be exported.
The formatter is defined through the formatter key, and the options and configuration is passed through the formatter_config key.

Available formatters

CSV

"formatter": "csv"

Available options:

{
  "formatter_config": {
    "delimiter": "<STRING>"
    "print_delimiter": BOOLEAN,
    "print_header": BOOLEAN,
    "header_format": "<STRING>",
    "prepend_columns": [...],
    "append_columns": [...]
  }
}
  • delimiter: defines the CSV delimiter. By default a comma ,.
  • print_delimiter: defines whether the first row should be the delimiter or not. By default true, meaning that the file starts with sep=, by default.
  • print_header: defines whether the CSV file should start with the column headers. By default true.
  • header_format: accepted values: verbose, slug, collection_slug. This option defines how we should display the headers in the exported file. Example: for the Is Indexable field, the three options respectively correspond to the header value: Is Indexable, indexable.is_indexable, crawl.YYYYMMDD.indexable.is_indexable. By default verbose.
  • prepend_columns: insert one or multiple columns before the data columns . By default empty.
  • append_columns: insert one or multiple columns after the data columns . By default empty.

Prepend and append columns

To insert a hard-coded values as first or last columns in the exports, the expected format is:

{
  "value": "<INSERTED_VALUE>",
  "name": "Verbose Header Name",
  "slug": "slug.header.name"
}

JSON

"formatter": "json"

Will return a JSON file containing one list, where each item is one data row.
The data rows are nested objects with respect to the dots in the field slugs. For example, the indexable.is_indexable would result in an object:

{
  "indexable": {
    "is_indexable": True
  }
}

No available options.

XML

"formatter": "xml"

Will return an XML file containing nested elements, with respect to the dots in the field slugs.

No available options.


Did this page help you?