← 返回 Skills 市场
发票识别
作者
1054570699
· GitHub ↗
· v1.0.0
· MIT-0
162
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install invoice-recognize
功能描述
发票 OCR 识别技能。扫描文件夹中的发票文件(PDF/图片),调用阿里云 OCR API 识别发票信息并导出到 Excel 表格。支持 17+ 种发票类型(增值税发票、火车票、出租车票、机票行程单、定额发票、机动车销售发票、过路过桥费发票等)。使用场景:(1) 用户提到"发票识别"、"发票统计"、"发票整理"、...
使用说明 (SKILL.md)
发票 OCR 识别技能
批量识别发票并汇总到 Excel 表格。
⚠️ 首次使用必须配置凭证
此技能需要阿里云 OCR 服务,使用前必须先配置凭证!
方式一:向用户提供凭证(推荐)
主动询问用户:
"使用此技能需要阿里云 AccessKey ID 和 AccessKey Secret,请提供这两个凭证。
获取方式:阿里云控制台 → 开通票据凭证识别 → 创建 AccessKey"
然后运行:
python scripts/recognize_invoices.py --config
方式二:引导用户自行配置
告诉用户:
"请先运行以下命令配置阿里云凭证:"
python ~/.openclaw/skills/invoice-ocr/scripts/recognize_invoices.py --config
特点
- ✅ 17+ 发票类型 - 自动识别发票类型
- ✅ Excel 输出 - 生成标准 xlsx 文件
- ✅ 支持 PDF/OFD - 电子发票友好
依赖安装
pip install openpyxl
支持的发票类型
| 类型 | 说明 |
|---|---|
| 增值税发票 | 专用发票、普通发票、电子发票 |
| 火车票 | 火车票识别 |
| 出租车发票 | 机打发票 |
| 定额发票 | 手撕发票 |
| 机票行程单 | 航空运输电子客票 |
| 机动车销售发票 | 购车发票 |
| 网约车行程单 | 滴滴等平台发票 |
| 过路过桥费 | 高速公路发票 |
| 客运车船票 | 汽车票、船票 |
| 税收完税证明 | 完税凭证 |
| 银行承兑汇票 | 票据识别 |
支持的文件格式
| 格式 | 扩展名 |
|---|---|
| OFD | .ofd |
| 图片 | .jpg, .jpeg, .png, .bmp, .gif, .tiff, .webp |
输出字段
按以下顺序输出到 Excel:
| 字段 | 说明 |
|---|---|
| 发票号码 | 发票代码 + 发票号码 |
| 开票日期 | 开票日期 |
| 购买方信息 | 购买方名称 |
| 销售方信息 | 销售方名称 |
| 项目名称 | 商品/服务名称 |
| 规格型号 | 商品规格 |
| 单位 | 计量单位 |
| 数量 | 商品数量 |
| 单价 | 商品单价 |
| 金额 | 不含税金额 |
| 税率 | 税率百分比 |
| 税额 | 税金金额 |
| 价税合计 | 含税总额 |
注意: 如果发票上某字段不存在,默认填空值。
使用方法
识别发票
# 识别文件夹中的所有发票
python scripts/recognize_invoices.py /path/to/invoices
# 指定输出文件
python scripts/recognize_invoices.py /path/to/invoices --output 发票汇总.xlsx
配置管理
# 设置阿里云凭证
python scripts/recognize_invoices.py --config
# 查看当前配置
python scripts/recognize_invoices.py --list-config
获取阿里云 AccessKey
详细 API 说明见 阿里云 OCR API 参考
工作流程
发票文件 → OCR识别 → Excel表格
↓ ↓ ↓
PDF/图片 混贴识别 xlsx文件
注意事项
- 图片需清晰,建议长宽 > 500px
- 单个文件不超过 10MB
- 阿里云 OCR 按次计费,注意费用控制
- 配置文件保存在技能目录下的 config.json
安全使用建议
This skill appears to do what it says: it will read invoice files you point it at, upload image/PDF bytes to Aliyun's OCR API, parse the response, and write an Excel file. Before installing or running it: (1) understand it will ask for and store your Aliyun AccessKey ID and Secret in config.json (plaintext) — avoid using root account keys; create a RAM sub-account with minimal AliyunOCR permissions and use those keys only; (2) invoices contain sensitive financial data — recognize that image bytes will be sent to Aliyun (cloud) and you may incur API charges; (3) review the script if you need to confirm no additional endpoints/behaviour; (4) consider running on a copy of invoice files and rotating keys after use. If you are uncomfortable storing credentials in plaintext, modify the script to use environment variables or a secure secrets store before use.
功能分析
Type: OpenClaw Skill
Name: invoice-recognize
Version: 1.0.0
The skill provides invoice OCR functionality by integrating with the official Alibaba Cloud OCR API. The Python script `scripts/recognize_invoices.py` correctly implements the Alibaba Cloud API signature algorithm and handles data transmission to the legitimate endpoint (ocr-api.cn-hangzhou.aliyuncs.com). While the `SKILL.md` instructions direct the AI agent to solicit sensitive credentials (AccessKey ID/Secret) from the user, this behavior is transparently documented and necessary for the tool's stated purpose. The credentials are stored locally in `config.json` and used exclusively for authenticating with the cloud service.
能力评估
Purpose & Capability
Name/description, SKILL.md, aliyun-ocr-api.md and the Python script all align: the skill scans invoice files, calls the Aliyun OCR endpoint, parses results and exports to Excel. The single external endpoint (ocr-api.cn-hangzhou.aliyuncs.com) matches the described purpose.
Instruction Scope
Runtime instructions are narrowly scoped to asking the user for Aliyun AccessKey ID/Secret (or guiding them to run --config), scanning a user-provided folder, calling Aliyun OCR, and exporting results. The skill does not instruct reading unrelated system files or contacting other endpoints. Note: it asks the agent to actively request secrets from the user, which is necessary for operation but sensitive.
Install Mechanism
No install spec; only a pip dependency (openpyxl) is recommended. The skill is instruction + single Python script; nothing is downloaded from arbitrary URLs. This is proportionate for the described functionality.
Credentials
The skill requests no environment variables but requires Aliyun AccessKey ID and Secret to operate. Those credentials are collected via interactive prompt or by running --config and are saved to a local config.json under the skill directory in plaintext. Saving secrets unencrypted to disk is a practical but sensitive choice—it's proportionate to the task but requires caution (prefer RAM subaccount, minimal permissions, and local key management).
Persistence & Privilege
always:false and no special privileges. The script writes its own config.json inside the skill directory and writes output Excel files—expected behavior. It does not modify other skills or system-wide settings.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install invoice-recognize - 安装完成后,直接呼叫该 Skill 的名称或使用
/invoice-recognize触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
invoice-ocr 1.0.0
- 切换底层识别平台为阿里云票据 OCR,原百度云依赖移除
- 新增 scripts/recognize_invoices.py,支持批量识别文件夹下发票并导出到 Excel
- 初次使用需配置阿里云 AccessKey,增加凭证引导说明
- 发票类型支持扩展至 17+ 种,涵盖常见报销场景
- 文档支持多格式文件(PDF、OFD、各图片格式)
- 安装与运行流程、输出字段和命令行参数全面更新
元数据
常见问题
发票识别 是什么?
发票 OCR 识别技能。扫描文件夹中的发票文件(PDF/图片),调用阿里云 OCR API 识别发票信息并导出到 Excel 表格。支持 17+ 种发票类型(增值税发票、火车票、出租车票、机票行程单、定额发票、机动车销售发票、过路过桥费发票等)。使用场景:(1) 用户提到"发票识别"、"发票统计"、"发票整理"、... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 162 次。
如何安装 发票识别?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install invoice-recognize」即可一键安装,无需额外配置。
发票识别 是免费的吗?
是的,发票识别 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
发票识别 支持哪些平台?
发票识别 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 发票识别?
由 1054570699(@1054570699)开发并维护,当前版本 v1.0.0。
推荐 Skills