PyPDFium2Loader
This notebook provides a quick overview for getting started with PyPDF
document loader. For detailed documentation of all DocumentLoader features and configurations head to the API reference.
Overview
Integration details
Class | Package | Local | Serializable | JS support |
---|---|---|---|---|
PyPDFLoader | langchain_community | ✅ | ❌ | ❌ |
Loader features
Source | Document Lazy Loading | Native Async Support | Extract Images | Extract Tables |
---|---|---|---|---|
PyPDFLoader | ✅ | ❌ | ✅ | ❌ |
Setup
Credentials
No credentials are required to use PyPDFLoader
.
To enable automated tracing of your model calls, set your LangSmith API key:
# os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")
# os.environ["LANGSMITH_TRACING"] = "true"
Installation
Install langchain_community and pypdf.
%pip install -qU langchain_community pypdfium2
Note: you may need to restart the kernel to use updated packages.
Initialization
Now we can instantiate our model object and load documents:
from langchain_community.document_loaders import PyPDFium2Loader
file_path = "./example_data/layout-parser-paper.pdf"
loader = PyPDFium2Loader(file_path)
API Reference:PyPDFium2Loader