mirror of
https://github.com/PaddlePaddle/PaddleOCR.git
synced 2026-09-21 13:23:18 +08:00
* feat: add multi-language API SDK for PaddleOCR async API Add Python/Go/TypeScript SDKs that wrap the PaddleOCR async job API (submit → poll → fetch result) into simple blocking interfaces. Python SDK: - Integrated into paddleocr/_api_client/ as internal subpackage - APIClient (sync) + AsyncAPIClient (asyncio) dual interfaces - CLI subcommand: paddleocr api --model_type ocr/doc_parsing - Supports PP-OCRv5, PP-StructureV3, PaddleOCR-VL, PaddleOCR-VL-1.5 Go SDK (api_sdk/go/): - Zero dependencies (stdlib only) - Functional options pattern + context.Context cancellation - Operation object with Wait(ctx)/Poll(ctx) methods TypeScript SDK (api_sdk/typescript/): - Zero dependencies (native fetch, Node>=18) - AbortSignal cancellation support - ESM + CJS dual output All SDKs share: - Exponential backoff polling (3s initial, 1.5x, 15s max, configurable timeout) - Typed error hierarchy (Auth/API/JobFailed/Timeout/Network/FileNotFound) - URL and local file upload support - Convenience methods + manual control (submit/wait/poll) interfaces * fix: address PR review feedback - Rename PaddleOCRError to PaddleOCRAPIError across all three SDKs - Replace custom FileNotFoundError with Python builtin in Python SDK - Expand OCROptions/DocParsingOptions with all API parameters (Python/Go/TS) - CLI: use Model enum values instead of hardcoded strings - CLI: allow --model for both ocr and doc_parsing tasks - Update license header year to 2026 - Simplify TypeScript defaultPayload to empty object * fix: harden multi-language API SDK Co-authored-by: Cursor <cursoragent@cursor.com> * fix(sdk): jsonl fetch without auth, poll timeout, abort parity Co-authored-by: Cursor <cursoragent@cursor.com> * feat: harden PaddleOCR official API SDK Align Python, TypeScript, and Go SDKs around typed jobs, model-aware document parsing, request/poll timeouts, strict errors, resource saving, and integrated release docs for the PaddleOCR official API. Co-authored-by: Cursor <cursoragent@cursor.com> * feat: complete API SDK remediation and default doc parsing to PaddleOCR-VL-1.5 Consolidate SDK hardening, docs, tests, and cross-language default model behavior for document parsing. Co-authored-by: Cursor <cursoragent@cursor.com> * Fix bugs * Fix bugs and optimize sdks * Fix bugs * Fix bugs * Update skills * Fix bugs * Update docs * Fix docs * Fix doc * Fix --------- Co-authored-by: Bobholamovic <bob1998425@hotmail.com> Co-authored-by: Cursor <cursoragent@cursor.com>
PaddleOCR official API SDKs
English | 简体中文
This directory contains source-adjacent maintainer files for the PaddleOCR official API SDKs. The SDKs call hosted PaddleOCR official API services; they do not run local PaddleOCR inference or load local models.
The official user documentation:
Maintainer Files
| File | Purpose |
|---|---|
typescript/README.md |
Package-level README for the TypeScript SDK. |
go/README.md |
Package-level README for the Go SDK. |
The Python SDK is part of the main paddleocr package.
Package Locations
| Language | Source location | User docs |
|---|---|---|
| Python | ../paddleocr |
Python SDK |
| TypeScript | typescript |
TypeScript SDK |
| Go | go |
Go SDK |
Validation
Run these from the PaddleOCR repo root directory:
# Python
python -m pytest tests/test_api_client_http.py tests/test_api_client_core.py tests/test_api_client_resources.py
# TypeScript
cd api_sdk/typescript
npm run lint
npm test
# Go
cd ../go
go test ./...