Skip to main content

An integration package connecting PaddleOCR and LangChain

Project description

langchain-paddleocr

PyPI - Version PyPI - License PyPI - Downloads

This package provides access to PaddleOCR's capabilities within the LangChain ecosystem.

Quick Install

pip install langchain-paddleocr

Basic Usage

PaddleOCRVLLoader

The PaddleOCRVLLoader enables you to:

  • Extract text and layout information from PDF and image files using models from Baidu's PaddleOCR-VL series (e.g., PaddleOCR-VL, PaddleOCR-VL-1.5, PaddleOCR-VL-1.6)
  • Process documents from local files or remote URLs

Basic usage of PaddleOCRVLLoader looks as follows:

from langchain_paddleocr import PaddleOCRVLLoader
from pydantic import SecretStr

loader = PaddleOCRVLLoader(
    file_path="path/to/document.pdf",
    base_url="your-api-endpoint",
    model="PaddleOCR-VL-1.5",
    access_token=SecretStr("your-access-token")  # Optional if using environment variable `PADDLEOCR_ACCESS_TOKEN`
)

docs = loader.load()

for doc in docs[:2]:
    print(f"Content: {doc.page_content[:200]}...")
    print(f"Source: {doc.metadata['source']}")
    print("---")

📖 Documentation

For full documentation, see the LangChain Docs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_paddleocr-0.2.1.tar.gz (362.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langchain_paddleocr-0.2.1-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file langchain_paddleocr-0.2.1.tar.gz.

File metadata

  • Download URL: langchain_paddleocr-0.2.1.tar.gz
  • Upload date:
  • Size: 362.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for langchain_paddleocr-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a9c6be5d3b49ad20bf5030a503e8cac9f1b9eceef548b85e63b82cbe742615c1
MD5 ab6420cd49dacdc9aaf4d5ed7d29613b
BLAKE2b-256 789665ebe955c29ddbe746d6da525c508dbdf34f4363197098581a79e649082c

See more details on using hashes here.

File details

Details for the file langchain_paddleocr-0.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_paddleocr-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19a06d14040a8dc8ef51cd96c0981d997a299d6bd9ace8d07330ede1adadc5f8
MD5 5db8a10a22c02b9bf756564cc3320554
BLAKE2b-256 c842a5c57640f69bdda8c8f87ce2b41df491473747aff1419c42af62504923f6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page