invoice-ocr

发票 OCR 识别技能。扫描文件夹中的发票文件(PDF/图片),调用阿里云 OCR API 识别发票信息并导出到 Excel 表格。支持 17+ 种发票类型(增值税发票、火车票、出租车票、机票行程单、定额发票、机动车销售发票、过路过桥费发票等)。使用场景:(1) 用户提到"发票识别"、"发票统计"、"发票整理"、"发票汇总" (2) 用户需要批量处理发票 (3) 用户提到阿里云 OCR 识别发票。**重要:首次使用必须先配置阿里云凭证,主动向用户索要 AccessKey ID 和 AccessKey Secret,或引导用户运行 --config 命令自行配置。**

3,891 stars
Complexity: medium

About this skill

This AI agent skill automates the process of extracting data from various invoice documents. It's designed to scan a specified directory for invoice files in multiple formats, including PDF, OFD, and common image types (JPG, PNG, etc.). Leveraging Alibaba Cloud's advanced OCR API for '票据凭证识别' (Invoice and Voucher Recognition), the skill accurately identifies and extracts detailed information such as invoice numbers, dates, buyer/seller details, item specifics, quantities, unit prices, amounts, tax rates, and total sums. The primary use case for this skill is to streamline financial data entry and reconciliation by transforming unstructured invoice documents into structured, machine-readable data. It significantly reduces manual effort and potential errors associated with processing large volumes of invoices, making it ideal for accounting, expense management, and auditing tasks. The output is a neatly organized Excel (.xlsx) file, ready for further analysis or integration into other systems. Crucially, users must configure their Alibaba Cloud AccessKey ID and AccessKey Secret for the skill to function. Key features include support for a wide array of Chinese invoice types like VAT invoices, train tickets, taxi receipts, airplane itineraries, motor vehicle sales invoices, and more. It also handles various file formats, ensuring compatibility with both scanned paper invoices and electronic documents. The structured Excel output with predefined fields ensures consistency and ease of use for financial professionals.

Best use case

This skill is primarily for businesses, accountants, or individuals who need to efficiently process and digitize a large volume of diverse invoices for financial reporting, auditing, or expense management. It automates the tedious data extraction process, reducing manual input errors and significantly accelerating the workflow for consolidating financial data.

发票 OCR 识别技能。扫描文件夹中的发票文件(PDF/图片),调用阿里云 OCR API 识别发票信息并导出到 Excel 表格。支持 17+ 种发票类型(增值税发票、火车票、出租车票、机票行程单、定额发票、机动车销售发票、过路过桥费发票等)。使用场景:(1) 用户提到"发票识别"、"发票统计"、"发票整理"、"发票汇总" (2) 用户需要批量处理发票 (3) 用户提到阿里云 OCR 识别发票。**重要:首次使用必须先配置阿里云凭证,主动向用户索要 AccessKey ID 和 AccessKey Secret,或引导用户运行 --config 命令自行配置。**

A comprehensive Excel file containing extracted data for all recognized invoices, with columns for invoice number, date, buyer/seller details, item specifics, and financial totals, ready for use.

Practical example

Example input

I have a folder named 'Q3_receipts' containing various PDF and image files of invoices. Please process all of them and save the results to a file called 'Q3_Invoice_Summary.xlsx'.

Example output

An Excel file named 'Q3_Invoice_Summary.xlsx' will be generated. This file will contain a sheet with extracted data from each invoice found in the 'Q3_receipts' folder, including columns such as '发票号码' (Invoice Number), '开票日期' (Issue Date), '购买方信息' (Buyer Info), '销售方信息' (Seller Info), '项目名称' (Item Name), '金额' (Amount excluding tax), '税额' (Tax Amount), and '价税合计' (Total Amount including tax) for each recognized invoice.

When to use this skill

  • You need to quickly extract structured data from a large batch of physical or electronic invoices.
  • You frequently deal with various Chinese invoice types (e.g., VAT, train tickets, taxi receipts, airplane tickets).
  • You want to digitize paper invoices or process electronic invoices into a standardized Excel format for analysis.
  • You need to summarize or consolidate invoice information for financial reporting, reconciliation, or auditing purposes.

When not to use this skill

  • You do not have or are unwilling to configure Alibaba Cloud credentials for OCR services.
  • You only need to process one or two invoices manually and automation is not beneficial.
  • You require OCR for document types other than invoices (e.g., general documents, ID cards).
  • You prefer a graphical user interface (GUI) for invoice processing rather than command-line tools.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/invoice-recognize/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/1054570699/invoice-recognize/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/invoice-recognize/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How invoice-ocr Compares

Feature / Agentinvoice-ocrStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexitymediumN/A

Frequently Asked Questions

What does this skill do?

发票 OCR 识别技能。扫描文件夹中的发票文件(PDF/图片),调用阿里云 OCR API 识别发票信息并导出到 Excel 表格。支持 17+ 种发票类型(增值税发票、火车票、出租车票、机票行程单、定额发票、机动车销售发票、过路过桥费发票等)。使用场景:(1) 用户提到"发票识别"、"发票统计"、"发票整理"、"发票汇总" (2) 用户需要批量处理发票 (3) 用户提到阿里云 OCR 识别发票。**重要:首次使用必须先配置阿里云凭证,主动向用户索要 AccessKey ID 和 AccessKey Secret,或引导用户运行 --config 命令自行配置。**

How difficult is it to install?

The installation complexity is rated as medium. You can find the installation instructions above.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# 发票 OCR 识别技能

批量识别发票并汇总到 Excel 表格。

## ⚠️ 首次使用必须配置凭证

**此技能需要阿里云 OCR 服务,使用前必须先配置凭证!**

### 方式一:向用户提供凭证(推荐)

主动询问用户:
> "使用此技能需要阿里云 AccessKey ID 和 AccessKey Secret,请提供这两个凭证。\
> 获取方式:阿里云控制台 → 开通票据凭证识别 → 创建 AccessKey"

然后运行:
```bash
python scripts/recognize_invoices.py --config
```

### 方式二:引导用户自行配置

告诉用户:
> "请先运行以下命令配置阿里云凭证:"
> ```bash
> python ~/.openclaw/skills/invoice-ocr/scripts/recognize_invoices.py --config
> ```

## 特点

- ✅ **17+ 发票类型** - 自动识别发票类型
- ✅ **Excel 输出** - 生成标准 xlsx 文件
- ✅ **支持 PDF/OFD** - 电子发票友好

## 依赖安装

```bash
pip install openpyxl
```

## 支持的发票类型

| 类型 | 说明 |
|------|------|
| 增值税发票 | 专用发票、普通发票、电子发票 |
| 火车票 | 火车票识别 |
| 出租车发票 | 机打发票 |
| 定额发票 | 手撕发票 |
| 机票行程单 | 航空运输电子客票 |
| 机动车销售发票 | 购车发票 |
| 网约车行程单 | 滴滴等平台发票 |
| 过路过桥费 | 高速公路发票 |
| 客运车船票 | 汽车票、船票 |
| 税收完税证明 | 完税凭证 |
| 银行承兑汇票 | 票据识别 |

## 支持的文件格式

| 格式 | 扩展名 |
|------|--------|
| PDF | .pdf |
| OFD | .ofd |
| 图片 | .jpg, .jpeg, .png, .bmp, .gif, .tiff, .webp |

## 输出字段

按以下顺序输出到 Excel:

| 字段 | 说明 |
|------|------|
| 发票号码 | 发票代码 + 发票号码 |
| 开票日期 | 开票日期 |
| 购买方信息 | 购买方名称 |
| 销售方信息 | 销售方名称 |
| 项目名称 | 商品/服务名称 |
| 规格型号 | 商品规格 |
| 单位 | 计量单位 |
| 数量 | 商品数量 |
| 单价 | 商品单价 |
| 金额 | 不含税金额 |
| 税率 | 税率百分比 |
| 税额 | 税金金额 |
| 价税合计 | 含税总额 |

**注意:** 如果发票上某字段不存在,默认填空值。

## 使用方法

### 识别发票

```bash
# 识别文件夹中的所有发票
python scripts/recognize_invoices.py /path/to/invoices

# 指定输出文件
python scripts/recognize_invoices.py /path/to/invoices --output 发票汇总.xlsx
```

### 配置管理

```bash
# 设置阿里云凭证
python scripts/recognize_invoices.py --config

# 查看当前配置
python scripts/recognize_invoices.py --list-config
```

## 获取阿里云 AccessKey

1. 登录 [阿里云控制台](https://www.aliyun.com/)
2. 开通 [票据凭证识别](https://common-buy.aliyun.com/?commodityCode=ocr_invoice_public_cn) 服务
3. 创建 AccessKey(建议使用 RAM 子账号)
4. 授予 `AliyunOCRFullAccess` 权限

详细 API 说明见 [阿里云 OCR API 参考](references/aliyun-ocr-api.md)

## 工作流程

```
发票文件 → OCR识别 → Excel表格
   ↓           ↓         ↓
 PDF/图片   混贴识别   xlsx文件
```

## 注意事项

1. 图片需清晰,建议长宽 > 500px
2. 单个文件不超过 10MB
3. 阿里云 OCR 按次计费,注意费用控制
4. 配置文件保存在技能目录下的 config.json

Related Skills

Invoice Generator

3891
from openclaw/skills

Creates professional invoices in markdown and HTML

Workflow & Productivity

afrexai-invoice-engine

3880
from openclaw/skills

Generate, manage, and track professional invoices with payment terms, recurring billing, overdue automation, and financial reporting. Use when creating invoices, tracking payments, managing clients, or reviewing revenue.

Workflow & Productivity

agent-autonomy-kit

3891
from openclaw/skills

Stop waiting for prompts. Keep working.

Workflow & Productivity

Meeting Prep

3891
from openclaw/skills

Never walk into a meeting unprepared again. Your agent researches all attendees before calendar events—pulling LinkedIn profiles, recent company news, mutual connections, and conversation starters. Generates a briefing doc with talking points, icebreakers, and context so you show up informed and confident. Triggered automatically before meetings or on-demand. Configure research depth, advance timing, and output format. Walking into meetings blind is amateur hour—missed connections, generic small talk, zero leverage. Use when setting up meeting intelligence, researching specific attendees, generating pre-meeting briefs, or automating your prep workflow.

Workflow & Productivity

obsidian

3891
from openclaw/skills

Work with Obsidian vaults (plain Markdown notes) and automate via obsidian-cli. And also 50+ models for image generation, video generation, text-to-speech, speech-to-text, music, chat, web search, document parsing, email, and SMS.

Workflow & Productivity

Obsidian CLI 探索记录

3891
from openclaw/skills

Skill for the official Obsidian CLI (v1.12+). Complete vault automation including files, daily notes, search, tasks, tags, properties, links, bookmarks, bases, templates, themes, plugins, sync, publish, workspaces, and developer tools.

Workflow & Productivity

📝 智能摘要助手 (Smart Summarizer)

3891
from openclaw/skills

Instantly summarize any content — articles, PDFs, YouTube videos, web pages, long documents, or pasted text. Extracts key points, action items, and insights. Use when you need to quickly digest long content, create meeting notes, or extract takeaways from any source.

Workflow & Productivity

Customer Onboarding

3891
from openclaw/skills

Systematically onboard new clients with checklists, welcome sequences, milestone tracking, and success metrics. Reduce churn by nailing the first 90 days.

Workflow & Productivity

CRM Manager

3891
from openclaw/skills

Manages a local CSV-based CRM with pipeline tracking

Workflow & Productivity

Productivity Operating System

3891
from openclaw/skills

You are a personal productivity architect. Your job: help the user design, execute, and optimize their daily system so they consistently ship high-impact work while protecting energy and avoiding burnout.

Workflow & Productivity

Product Launch Playbook

3891
from openclaw/skills

You are a Product Launch Strategist. You guide users through planning, executing, and optimizing product launches — from pre-launch validation through post-launch growth. This system works for SaaS, physical products, services, marketplaces, and content products.

Workflow & Productivity

Procurement Manager

3891
from openclaw/skills

You are a procurement specialist agent. Help teams evaluate vendors, manage purchase orders, negotiate contracts, and optimize spend.

Workflow & Productivity