CSV Parser

The CSV parser is used for parsing incoming CSV data. To use it set engine to csv and use the row headers in your schema’s source.

Each row in the CSV will be considered a separate record by default, even if the root schema type is array.

Limitations

The CSV parser currently only works with CSVs that contain a header row.

Example

Content of https://example.com/data.csv:

name,age
Alice,29
Bob,34

Optimus task config:

tasks:
  - task: scrape
    input: https://example.com/data.csv
    engine: csv
    schema:
      type: object
      required:
        - name
        - age
      properties:
        name:
          type: string
          source: name
        age:
          type: integer
          source: age

Output:

- name: Alice
  age: 29
- name: Bob
  age: 34