File Directory

class DirectoryReader

Directory reader.

Reads files from a directory, optionally filtering by file extension and allowing recursive directory traversal.

Parameters:
  • required_exts (List[str], optional) – List of file extensions to filter by. Only files with these extensions will be loaded. Defaults to None (no filtering).

  • recursive (bool, optional) – Whether to recursively search subdirectories for files. Defaults to False.

Example

from pineflow.core.readers import DirectoryReader

directory_reader = DirectoryReader()
load_data(input_dir)

Loads data from the specified directory.

Parameters:

input_dir (str) – Directory path from which to load the documents.

Returns:

A list of documents loaded from the directory.

Return type:

List[Document]