Overview
CSV loader processes CSV files with options to create documents per row, per chunk, or as a single document. Supports column filtering and flexible content formatting. Loader Class:CSVLoader
Config Class: CSVLoaderConfig
Install
Install the CSV loader optional dependency group:
Examples
Parameters
| Parameter | Type | Description | Default | Source |
|---|---|---|---|---|
encoding | str | None | File encoding (auto-detected if None) | None | Base |
error_handling | "ignore" | "warn" | "raise" | How to handle loading errors | ”warn” | Base |
include_metadata | bool | Whether to include file metadata | True | Base |
custom_metadata | dict | Additional metadata to include | Base | |
max_file_size | int | None | Maximum file size in bytes | None | Base |
skip_empty_content | bool | Skip documents with empty content | True | Base |
content_synthesis_mode | "concatenated" | "json" | How to create document content from rows | ”concatenated” | Specific |
split_mode | "single_document" | "per_row" | "per_chunk" | How to split CSV into documents | ”single_document” | Specific |
rows_per_chunk | int | Number of rows per document (for per_chunk mode) | 100 | Specific |
include_columns | list[str] | None | Only include these columns | None | Specific |
exclude_columns | list[str] | None | Exclude these columns | None | Specific |
delimiter | str | CSV delimiter | ”,“ | Specific |
quotechar | str | CSV quote character | ’“‘ | Specific |
has_header | bool | Whether CSV has a header row | True | Specific |

