pyarrow.csv.ParseOptions

class pyarrow.csv.ParseOptions(delimiter=None, *, quote_char=None, double_quote=None, escape_char=None, newlines_in_values=None, ignore_empty_lines=None, invalid_row_handler=None)

Bases: pyarrow.lib._Weakrefable

Options for parsing CSV files.

Parameters
delimiter1-character str, optional (default ‘,’)

The character delimiting individual cells in the CSV data.

quote_char1-character str or False, optional (default ‘”’)

The character used optionally for quoting CSV values (False if quoting is not allowed).

double_quotebool, optional (default True)

Whether two quotes in a quoted CSV value denote a single quote in the data.

escape_char1-character str or False, optional (default False)

The character used optionally for escaping special characters (False if escaping is not allowed).

newlines_in_valuesbool, optional (default False)

Whether newline characters are allowed in CSV values. Setting this to True reduces the performance of multi-threaded CSV reading.

ignore_empty_linesbool, optional (default True)

Whether empty lines are ignored in CSV input. If False, an empty line is interpreted as containing a single empty value (assuming a one-column CSV file).

invalid_row_handlercallable(), optional (default None)

If not None, this object is called for each CSV row that fails parsing (because of a mismatching number of columns). It should accept a single InvalidRow argument and return either “skip” or “error” depending on the desired outcome.

__init__(*args, **kwargs)

Methods

__init__(*args, **kwargs)

equals(self, ParseOptions other)

validate(self)

Attributes

delimiter

The character delimiting individual cells in the CSV data.

double_quote

Whether two quotes in a quoted CSV value denote a single quote in the data.

escape_char

The character used optionally for escaping special characters (False if escaping is not allowed).

ignore_empty_lines

Whether empty lines are ignored in CSV input.

invalid_row_handler

Optional handler for invalid rows.

newlines_in_values

Whether newline characters are allowed in CSV values.

quote_char

The character used optionally for quoting CSV values (False if quoting is not allowed).

delimiter

The character delimiting individual cells in the CSV data.

double_quote

Whether two quotes in a quoted CSV value denote a single quote in the data.

equals(self, ParseOptions other)
escape_char

The character used optionally for escaping special characters (False if escaping is not allowed).

ignore_empty_lines

Whether empty lines are ignored in CSV input. If False, an empty line is interpreted as containing a single empty value (assuming a one-column CSV file).

invalid_row_handler

Optional handler for invalid rows.

If not None, this object is called for each CSV row that fails parsing (because of a mismatching number of columns). It should accept a single InvalidRow argument and return either “skip” or “error” depending on the desired outcome.

newlines_in_values

Whether newline characters are allowed in CSV values. Setting this to True reduces the performance of multi-threaded CSV reading.

quote_char

The character used optionally for quoting CSV values (False if quoting is not allowed).

validate(self)