VAT Invoice OCR Skill for Openclaw

An automated data extraction tool that transforms VAT invoice images and PDFs into structured Excel reports using high-precision OCR technology.

pengyulong
v1.0.0
Mar 13, 2026
0
1.1k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install invoice-ocr

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install invoice-ocr using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is VAT Invoice OCR Skill?

The VAT Invoice OCR Skill is a professional-grade automation tool designed to handle the complexities of financial document processing. It supports both single and multi-page PDF documents alongside common image formats like PNG and JPG. By integrating with the Baidu Cloud VAT OCR API, this skill within the Openclaw Skills framework converts unstructured invoice scans into clean, actionable data.

The system is built with a focus on reliability, featuring three core processing stages: invoice detection, structured field extraction, and automated quality scoring. It is an essential component for developers and finance professionals looking to eliminate manual data entry and improve document auditing workflows through Openclaw Skills.

VAT Invoice OCR Skill Use Cases

  • Batch processing stacks of physical invoices into a single digital summary.
  • Automating the ingestion of PDF invoices from email attachments into financial systems.
  • Performing quality control on scanned documents to identify low-clarity images.
  • Integrating structured invoice data into larger ERP or bookkeeping automation workflows.

How VAT Invoice OCR Skill Works

  1. Input Normalization: The skill converts various file formats into standard JPEG byte streams and compresses oversized images to optimize API performance.
  2. Validation Check: It performs a preliminary scan to filter out non-invoice images using keyword and regex-based detection.
  3. Secure Extraction: Using stored environment credentials, the skill calls specialized OCR APIs to extract fields like invoice numbers, dates, and amounts.
  4. Intelligent Fallback: If a specific invoice type is not recognized, it automatically switches to a general OCR engine to salvage as much data as possible.
  5. Quality Scoring: Every extraction is graded on a 100-point scale based on field completeness and engine confidence.
  6. Excel Generation: All results are compiled into a formatted Excel report for easy downloading and review.

VAT Invoice OCR Skill Setup

To deploy this skill, ensure you have your API credentials ready from the Baidu Intelligent Cloud console.

# Install the required Python libraries
pip install pymupdf openpyxl requests Pillow python-dotenv --break-system-packages -q

# Configure your .env file with the following keys:
# BAIDU_API_KEY=your_key_here
# BAIDU_SECRET_KEY=your_secret_here

# Run the skill via the command line
python invoice_ocr_main.py --input <path_to_invoice> --output ./result.xlsx

VAT Invoice OCR Skill Data Schema & Taxonomy

The skill generates a structured Excel report (default: result.xlsx) containing a single sheet named Invoice Summary. The data is organized into the following columns:

Column Name Description
Page Number The index of the page within the source document
Invoice Type Category of the document (e.g., Special VAT Invoice)
Invoice Number The unique identification code of the invoice
Issue Date The date the invoice was generated
Seller Info Name and details of the service provider
Buyer Info Name and details of the purchaser
Total Amount The sum of price and tax extracted
Quality Grade A visual indicator (Excellent, Good, or Poor) based on extraction confidence

VAT Invoice OCR Skill Advanced Features

  • Multi-page PDF Rendering: Uses PyMuPDF to split and process individual pages of complex documents.
  • Adaptive Compression: Automatically resizes and re-encodes images to meet strict API payload limits without losing critical detail.
  • Resilient Retries: Features a tiered retry mechanism to handle network instability or API rate limiting.
  • Automated Cleanup: Performs string cleaning to remove common OCR noise like extra spaces or special characters in tax IDs.
  • Seamless Integration: Designed to work as a modular component within the broader Openclaw Skills ecosystem for multi-agent workflows.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*