mirror of
https://github.com/hwchase17/langchain
synced 2024-11-06 03:20:49 +00:00
3637d6da6e
# ODF File Loader Adds a data loader for handling Open Office ODT files. Requires `unstructured>=0.6.3`. ### Testing The following should work using the `fake.odt` example doc from the [`unstructured` repo](https://github.com/Unstructured-IO/unstructured). ```python from langchain.document_loaders import UnstructuredODTLoader loader = UnstructuredODTLoader(file_path="fake.odt", mode="elements") loader.load() loader = UnstructuredODTLoader(file_path="fake.odt", mode="single") loader.load() ```
13 lines
339 B
Python
13 lines
339 B
Python
from pathlib import Path
|
|
|
|
from langchain.document_loaders import UnstructuredODTLoader
|
|
|
|
|
|
def test_unstructured_odt_loader() -> None:
|
|
"""Test unstructured loader."""
|
|
file_path = Path(__file__).parent.parent / "examples/fake.odt"
|
|
loader = UnstructuredODTLoader(str(file_path))
|
|
docs = loader.load()
|
|
|
|
assert len(docs) == 1
|