Skip to main content

Parameters

ParameterTypeDefaultDescription
configDOCXLoaderConfigRequiredConfiguration object for DOCX loading behavior

Functions

__init__

Initializes the DOCXLoader with its specific configuration. Parameters:
  • config (DOCXLoaderConfig): Configuration object for DOCX loading behavior

get_supported_extensions

Gets the list of supported file extensions. Returns:
  • List[str]: List of supported file extensions (.docx)

_format_table

Formats a table object into a string based on the config. Parameters:
  • table (DocxTable): Table object to format
Returns:
  • str: Formatted table string

_load_single_file

Helper method to load a single .docx file into one or zero Documents. Parameters:
  • file_path (Path): Path to the DOCX file
Returns:
  • List[Document]: List of documents loaded from the file

load

Loads documents from the given .docx source(s) synchronously. Parameters:
  • source (Union[str, Path, List[Union[str, Path]]]): DOCX source(s) to load from
Returns:
  • List[Document]: List of loaded documents

aload

Loads documents from the given .docx source(s) asynchronously. Parameters:
  • source (Union[str, Path, List[Union[str, Path]]]): DOCX source(s) to load from
Returns:
  • List[Document]: List of loaded documents

batch

A synchronous batch load implementation. Parameters:
  • sources (List[Union[str, Path]]): List of DOCX sources to load
Returns:
  • List[Document]: List of loaded documents

abatch

An efficient asynchronous batch load implementation using asyncio.gather. Parameters:
  • sources (List[Union[str, Path]]): List of DOCX sources to load
Returns:
  • List[Document]: List of loaded documents
I