Catalog PyPI
PACKAGE EXPLORERView in registry

agentic-doc-parse-and-extract

PyPI

AI Document Platform Command Line Tool - Document Parse & Extract Tool

adpaiclidocumentextractparse
Versions collected1
Direct dependencies11From release 1.10.3
Last observed20 Oct, 22:15 UTC

README

Version 1.10.3 documentation

🚀 About Laiye ADP

ADP is Laiye's intelligent agent document processing product (Agentic Document Processing, referred to as ADP) , based on the general understanding ability of large models, without relying on rules and annotations, with the general understanding ability of multi-language, MultiModal Machine Learning, and multi-scene; autonomous planning and execution of intelligent agents, able to understand task goals, autonomous planning steps, invoke tools, and complete complex tasks; end-to-end business automation, from document input to business decision-making to human-machine collaboration, forming a complete closed loop.

agentic-doc-parse-and-extract is the official open-source CLI tool of ADP, supporting both manual terminal invocation and automatic invocation via AI Skill. With a single command, it can accomplish: structured document parsing + intelligent extraction of key fields, covering all scenarios including invoices, orders, certificates, bills, and general documents, outputting standard JSON, and seamlessly integrating with automation and AI workflows.


💡 Core Features

agentic-doc-parse-and-extract focuses on intelligent processing of the entire document workflow, taking into account both manual terminal calls and automatic calls by AI Agents. Its core functions cover all scenarios of parsing, extraction, and batch processing, requiring no complex configuration, and operations can be completed with a single command:

Function NameFunction DescriptionOptimal Scenario
Document ParsingAutomatically recognize multi-format documents such as PDFs and images, convert messy unstructured content (e.g., scanned documents, handwritten text, complex layout documents) into standardized Structured Data, while preserving the original document hierarchy and key relationshipsConvert unstructured documents into Structured Data for LLM reading and subsequent extraction
Out Of The Box Document ExtractionBased on the native AI capabilities of the ADP large model, it comes with built-in standardized extraction models for invoices, receipts, orders, commonly used certificates in China, etc. No need to configure rules or manual annotation, one-click extraction of key fields from various types of general documentation, outputting standard JSONAccount Payable automation, expense management, procurement automation, quick entry of card and certificate information into the system
Custom Document ExtractionSupports independent creation, editing, and management of personalized extraction applications, allowing configuration of exclusive extraction fields and recognition logic for enterprise-specific documentation and industry-customized formsPrivate extraction requirements for enterprise-specific documentation, industry-customized forms, and non-standardized documents
Task QuerySupports asynchronous task submission and status query, enabling quick viewing of task execution progress, success/failure status, and final task processing resultsBatch task processing, asynchronous document processing, problem troubleshooting, and processing record tracing
Application ManagementProvides comprehensive application management capabilities, allowing users to view all available extraction applications (system-built + custom), query application details, and manage application tagsMulti-scenario business switching, full lifecycle management of applications, and custom application management

Installation and Update

Install from Source Code

pip install -e .

Install from PyPI

pip install agentic_doc_parse_and_extract

Version Update

Note: This package is no longer maintained on PyPI. Please update via npm instead:

npm install -g @laiye-adp/agentic-doc-parse-and-extract-cli

Configure

Get an API key at https://adp-global.laiye.com/ (new users get 100 free credits per month).

adp config set --api-key <your-api-key>
adp config set --api-base-url https://adp-global.laiye.com
adp config get

Quick Examples

# List available apps
adp app-id list

# Parse a local document
adp parse local ./invoice.pdf --app-id <app-id>

# Extract key fields
adp extract local ./invoice.pdf --app-id <app-id>

# Parse a directory in async mode
adp parse local ./documents/ --app-id <app-id> --async

# Process a remote URL
adp extract url https://example.com/file.pdf --app-id <app-id>

# Query an async task
adp parse query <task-id>

# Two-phase async (submit + query separately, resumable)
adp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json
adp extract query --watch --file tasks.json

# Auto retry on failure (up to 2 retries)
adp parse local ./documents/ --app-id <app-id> --retry 2

# Check remaining credits
adp credit

Commands

AI agents should call adp schema for the machine-readable, authoritative command spec. The table below is a human-friendly summary.

CommandDescription
adp versionPrint version
adp config setSet API key / base URL
adp config getShow current config
adp config clearClear config
adp app-id listList available apps
adp app-id cacheRead app list from local cache
adp parse local <path>Parse local file/directory
adp parse url <url>Parse remote file (URL list file supported)
adp parse base64 <data>Parse Base64-encoded content
adp parse query <task-id...>Query async parse tasks (supports multiple IDs or --file)
adp extract local <path>Extract from local file/directory
adp extract url <url>Extract from remote file
adp extract base64 <data>Extract from Base64-encoded content
adp extract query <task-id...>Query async extract tasks (supports multiple IDs or --file)
adp custom-app createCreate a custom extraction app
adp custom-app updateUpdate custom app config
adp custom-app get-configShow app config
adp custom-app deleteDelete a custom app
adp custom-app delete-versionDelete a specific config version
adp custom-app ai-generateAI-recommend extraction fields
adp creditShow remaining credits
adp schemaOutput command schema (for AI agents)

Flags

FlagDescription
--jsonOutput JSON
--quietQuiet mode, output result only
--lang <en|zh>Interface language
--app-idApp ID (required for parse / extract)
--asyncAsync mode
--no-waitSubmit tasks only, do not wait for results (use with --async)
--export <path>Export result to file (single file) or directory (batch)
--timeout <seconds>Timeout (default 900s)
--concurrency <n>Concurrent workers (free: max 1, paid: max 2)
--retry <n>Retries for retryable errors (default 0)
--file <path>Read task IDs from JSON file (output of --no-wait, query only)

Async Workflow

For large files or batch jobs, submit with --async and the CLI returns a task-id. Poll for results with parse query / extract query:

adp parse local ./big.pdf --app-id <app-id> --async
# returns a task-id

adp parse query <task-id>

Two-Phase Async (--no-wait)

By default, --async submits and polls until completion — ideal for AI agents. For resumable workflows, use two-phase mode:

Phase 1: Submit tasks

adp extract local ./documents/ --app-id <app-id> --async --no-wait --export tasks.json

Output is a JSON array with task IDs:

[
  {"path": "invoice.pdf", "task_id": "task_abc123"},
  {"path": "contract.pdf", "task_id": "task_def456"}
]

Phase 2: Query results

adp extract query --watch --file tasks.json
adp extract query --watch --file tasks.json --export ./results/

Even if the CLI crashes mid-way, task IDs in tasks.json are preserved — resume anytime with query --file.

Batch Processing

When processing multiple files/URLs, the CLI writes each result to a separate file:

adp_results_20250417_153020/
├── _summary.json              # Summary (total, success, failed, per-file status)
├── invoice_01.pdf.json        # Successful result
├── contract_02.docx.json
└── report_03.pdf.error.json   # Error details
  • --export <dir> — specify output directory
  • Without --export — auto-creates adp_results_<timestamp>/
  • Single file — outputs to stdout or the --export file path

Exit Codes

CodeMeaning
0All success
1All failed / system error
2Parameter error
3Resource not found
4Permission denied
5Conflict
6Partial failure (some tasks failed in batch)

Environment Variables

VariableDescription
ADP_API_KEYAPI key (overrides config file)
ADP_API_BASE_URLService URL
ADP_LANGInterface language (en / zh)
ADP_LOG_LEVELLog level (debug / info / warn / error)

Config Storage

  • Config dir: ~/.adp/
  • Config file: ~/.adp/config.json
  • Encrypted API key: ~/.adp/key.enc (AES-256-GCM)
  • App cache: ~/.adp/app_cache.json
  • Version check cache: ~/.adp/version_check.json (refreshed every 24h)

📜 License

We adopt a combined model of open-source tools + paid services: the CLI tool is completely free and open-source, making it easy for everyone to quickly integrate; while the core ADP intelligent parsing capability is a Public Cloud commercial service, billed based on actual usage, aiming to provide users with a highly accurate and stable document processing experience.

  • CLI Tool: Open source under the MIT License, freely available for use, modification, and distribution
  • ADP Service: AI document processing service based on Public Cloud, billed by usage, Billing Rules

Free Quota: New users can receive 100 free credits per month after registration, allowing them to experience full functionality

📞 Support and Contact

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.10.324 Apr 202611

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
laiye-adp/adp-cli

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:15 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:2395330cb67247557c314f3663137e1d9e8d46326b02c8030c5e6e4a9d07bf30