pyarrow.csv.WriteOptions#

class pyarrow.csv.WriteOptions(include_header=None, *, batch_size=None, delimiter=None, quoting_style=None)#

Bases: _Weakrefable

Options for writing CSV files.

Parameters:
include_headerbool, optional (default True)

Whether to write an initial header line with column names

batch_sizeint, optional (default 1024)

How many rows to process together when converting and writing CSV data

delimiter1-character str, optional (default “,”)

The character delimiting individual cells in the CSV data.

quoting_stylestr, optional (default “needed”)

Whether to quote values, and if so, which quoting style to use. The following values are accepted:

  • “needed” (default): only enclose values in quotes when needed.

  • “all_valid”: enclose all valid values in quotes; nulls are not quoted.

  • “none”: do not enclose any values in quotes; values containing special characters (such as quotes, cell delimiters or line endings) will raise an error.

__init__(*args, **kwargs)#

Methods

__init__(*args, **kwargs)

validate(self)

Attributes

batch_size

How many rows to process together when converting and writing CSV data.

delimiter

The character delimiting individual cells in the CSV data.

include_header

Whether to write an initial header line with column names.

quoting_style

Whether to quote values, and if so, which quoting style to use.

batch_size#

How many rows to process together when converting and writing CSV data.

delimiter#

The character delimiting individual cells in the CSV data.

include_header#

Whether to write an initial header line with column names.

quoting_style#

Whether to quote values, and if so, which quoting style to use. The following values are accepted:

  • “needed” (default): only enclose values in quotes when needed.

  • “all_valid”: enclose all valid values in quotes; nulls are not quoted.

  • “none”: do not enclose any values in quotes; values containing special characters (such as quotes, cell delimiters or line endings) will raise an error.

validate(self)#