PaddleOCR CLI
A command-line tool for OCR using PaddleOCR AI Studio API.
Available in both Go (native binary) and Python versions.
Installation
Go Version (Recommended)
Download Binary
Download the latest release from GitHub Releases.
Using Homebrew (macOS/Linux)
brew install Explorer1092/tap/paddleocr-cli
Build from Source
git clone https://github.com/Explorer1092/paddleocr_cli.git
cd paddleocr_cli
go build -o paddleocr-cli ./cmd/paddleocr-cli
Python Version
Using pip
pip install paddleocr-cli
Using uv
uv pip install paddleocr-cli
Using Poetry (Development)
git clone https://github.com/Explorer1092/paddleocr_cli.git
cd paddleocr_cli
poetry install
Quick Start
1. Configure credentials
# Configure (default saves to user directory)
paddleocr-cli configure --server-url https://your-server.com --token YOUR_TOKEN
# Configure with scope
paddleocr-cli configure --server-url URL --token TOKEN -s project # project root
paddleocr-cli configure --server-url URL --token TOKEN -s local # current directory
paddleocr-cli configure --server-url URL --token TOKEN -s user # ~/.config/ (default)
# Verify configuration
paddleocr-cli configure --show
# Test connection
paddleocr-cli configure --test
2. Run OCR
# Output to stdout
paddleocr-cli resume.pdf
# Output to file
paddleocr-cli resume.pdf -o output.md
# Output as JSON
paddleocr-cli resume.pdf --json
Usage
paddleocr-cli [OPTIONS] FILE
positional arguments:
FILE Path to PDF or image file
options:
-o, --output FILE Output file path (default: stdout)
--json Output as JSON instead of markdown
--page N Extract only page N (0-indexed)
--no-separator Don't add page separators in markdown output
--timeout SECONDS Request timeout in seconds (default: 120)
--orientation Enable document orientation classification
--unwarp Enable document unwarping
--chart Enable chart recognition
-q, --quiet Suppress progress messages
--config FILE Path to config file
Configure subcommand
paddleocr-cli configure [OPTIONS]
options:
--server-url URL Set the server URL (required)
--token TOKEN Set the access token (required)
-s, --scope SCOPE Installation scope (default: user)
user - ~/.config/paddleocr_cli/
project - project root (alongside .claude/)
local - current directory
--show Show current configuration
--test Test connection to the server
--locations Show config file search locations
Configuration
Configuration is stored in YAML format (.paddleocr_cli.yaml). The tool searches for config files in this order:
- Current directory:
./.paddleocr_cli.yaml - Project root:
<project>/.paddleocr_cli.yaml(alongside.claude/directory) - User directory:
~/.config/paddleocr_cli/config.yaml
Config file format
paddleocr:
server_url: "https://your-server.aistudio-app.com"
access_token: "your_token_here"
Python API
You can also use the Python library programmatically:
from paddleocr_cli import PaddleOCRClient, Config, PaddleOCRConfig
# Use default config (from config files)
client = PaddleOCRClient()
# Or provide custom config
config = Config(
paddleocr=PaddleOCRConfig(
server_url="https://your-server.com",
access_token="your_token",
)
)
client = PaddleOCRClient(config)
# Perform OCR
result = client.ocr_file("document.pdf")
if result.success:
print(result.full_markdown)
for page in result.pages:
print(f"Page {page.page_index}: {len(page.markdown)} chars")
else:
print(f"Error: {result.error_message}")
Running Python version as a module
# Using python -m
python -m paddleocr_cli resume.pdf
# Using poetry
poetry run paddleocr-cli resume.pdf
# Using uv
uv run paddleocr-cli resume.pdf
License
MIT License
Metadata
Release files for paddleocr-cli 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| paddleocr_cli-0.2.1.tar.gz | 10.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| paddleocr_cli-0.2.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 22.6 kB
Release files / paddleocr_cli-0.2.1.tar.gz
| Download URL | paddleocr_cli-0.2.1.tar.gz |
|---|---|
| Size | 10.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5de2d006100b259d6a25f2e299304ac5e1688a1f98e5d8f44d0746a78aa5041
|
|
BLAKE2b-256 checksum How to use checksums |
7b32ef656bdd2bc8c9d4fd885f631a0437d11ffa2784a3050b6c8e4090324e4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 9, 2026.
Transparency logRelease files / paddleocr_cli-0.2.1-py3-none-any.whl
| Download URL | paddleocr_cli-0.2.1-py3-none-any.whl |
|---|---|
| Size | 12.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9c02c3a248b7121e82de335ae38e90967be30c07b27266e9fdfc36719bb0459a
|
|
BLAKE2b-256 checksum How to use checksums |
da4097588cbb97e76db66f1ad205548bf52d90cf350b438a355ba08676f09815
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jan 9, 2026.
Transparency log