Skip to main content
A comma-separated values (CSV) file is a delimited text file that uses a comma to separate values. Each line of the file is a data record. Each record consists of one or more fields, separated by commas.
Load csv data with a single row per document.

Customizing the csv parsing and loading

See the csv module documentation for more information of what csv args are supported.

Specify a column to identify the document source

Use the source_column argument to specify a source for the document created from each row. Otherwise file_path will be used as the source for all documents created from the CSV file. This is useful when using documents loaded from CSV files for chains that answer questions using sources.

UnstructuredCSVLoader

You can also load the table using the UnstructuredCSVLoader. One advantage of using UnstructuredCSVLoader is that if you use it in "elements" mode, an HTML representation of the table will be available in the metadata.

Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.