pyarrow.csv.WriteOptions#
- class pyarrow.csv.WriteOptions(include_header=None, *, batch_size=None, delimiter=None, quoting_style=None, quoting_header=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_size
int
, 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_style
str
, 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.
- quoting_header
str
, optional (default “needed”) Same as quoting_style, but for header column names. Accepts same values. Note : both “needed” and “all_valid” have the same effect of quoting all column names.
- include_headerbool, optional (default
- __init__(*args, **kwargs)#
Methods
Attributes
How many rows to process together when converting and writing CSV data.
The character delimiting individual cells in the CSV data.
Whether to write an initial header line with column names.
Same as quoting_style, but for header column names.
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_header#
Same as quoting_style, but for header column names. Note : both “needed” and “all_valid” have the same effect of quoting all 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)#