Class - builtin.xsv.xsv.iov2.input.XsvInput

JSON Schema

XsvInput

Read a CSV/TSV file using csv.reader and provide the data to the remaining steps of the job.

In Mitto 2.9.4 and earlier, any keyword args not used to construct the XsvInput class were passed as keyword args to csv.reader. In Mitto 2.9.5, a csv_kwargs keyword arg was added to XsvInput; its contents will be passed as keyword args to csv.reader. The earlier behavior is still supported but use of the new parameter is encouraged for new jobs.

Example usage:

{
    "input": {
        "use": "xsv.iov2#XsvInput",
        "source": "/var/mitto/data/test_csv.csv",
        "encoding": "ASCII",
        "delimiter": ",",
        "includes_header": true
    },
    "output": {}
}
{
    "input": {
        "use": "xsv.iov2#XsvInput",
        "source": "/var/mitto/data/test_csv.csv",
        "encoding": "ASCII",
        "delimiter": ",",
        "includes_header": true
        "csv_kwargs": {
            "foo": 1,
        }
    },
    "output": {}
}

type

object

properties

  • source

Source

The name of the XSV file for processing.

If source is a relative path, its value will be appended to /tmp/mitto/data

type

string

format

path

  • encoding

Encoding

Specify the file encoding.

Encodings are case insensitive, i.e. both utf-8 and UTF-8 will work. Follow this link for a list of common encodings: https://en.wikipedia.org/wiki/Character_encoding#Common_character_encodings

type

string

examples

ASCII

utf-8

ISO-8859-9

  • noneify

Noneify

Pass in a list of values you wish to convert to null.

Matches will be case sensitive.

examples

(‘’, ‘#Error’)

[‘none’, ‘NONE’, ‘None’]

default

True

anyOf

type

boolean

type

array

items

type

array

items

  • includes_header

Includes Header

Set to false if XSV does not have a header row.

If set to false the first row will be treated as data and names will be given to columns (Ex: col1, col2, etc).

type

boolean

examples

true

false

default

True

  • skip

Skip

Skip x number of lines.

type

integer

minimum

0

default

0

  • csv_kwargs

Csv Kwargs

Key/value pairs which will be passed as kwargs to csv.reader().

type

object

default

additionalProperties

False