Documents & office · Conversion & formats
document-parsing
/document-parsing
文档解析技能。当用户需要从 PDF、Word、Excel、图片(OCR)等文档中提取文本与结构化内容时使用。
For whom
- Author
- auditaih ↗
- Repository
- audit-tool-skills ↗
- Licence
- MIT
- Last repository change
- 11.08.2026
Assessment and security
96/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability21 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
- Files in this package
- 3
- Scripts
- 1
- HTML comments
- 0
- URLs in SKILL.md
- 0
Deprecation
No signals detected. Repository changed on 11.08.2026, without references to retired models or APIs.
Licence
MIT, open: use and modify while retaining author attribution.
What to check before installing
- 1 scripts in this package. Review them before installing, as Claude may execute them.
Scripts: scripts/parse.py
What it does and when to use it
文档解析技能。当用户需要从 PDF、Word、Excel、图片(OCR)等文档中提取文本与结构化内容时使用。
Original author description
文档解析技能。当用户需要从 PDF、Word、Excel、图片(OCR)等文档中提取文本与结构化内容时使用。
How it works
- 适用场景
- 支持文档类型
- 解析流程
- 工具建议(按可用性选择)
- 结构化输出
- 表格与版面理解要点
- 注意事项
- 输出校验
- 脚本说明
Original SKILL.md headings · 109 lines, 286 words
SKILL.md preview
---
name: document-parsing
description: 文档解析技能。当用户需要从 PDF、Word、Excel、图片(OCR)等文档中提取文本与结构化内容时使用。
---
# 文档解析技能(Document Parsing)
## 适用场景
将各类文档转换为可处理的文本与结构化数据,典型用途包括:单据/凭证提取、报表解析、合同条款抽取、扫描件数字化等。
## 支持文档类型
| 类型 | 扩展名 | 说明 |
| --- | --- | --- |
| PDF | `.pdf` | 文本型 / 扫描型均支持 |
| Word | `.docx` | 段落、表格、样式 |
| Excel | `.xlsx` / `.xls` | 工作表、单元格、表格 |
| 图片 | `.png` / `.jpg` / `.tif` 等 | 通过 OCR 识别 |
## 解析流程
1. **识别类型**:依据扩展名 / 文件头判断文档类型
2. **选择工具**:按类型映射到对应解析工具
3. **提取内容**:抽取文本、表格、图像、元数据
4. **结构化输出**:整理为段落 / 表格 / 键值对的结构化结果
## 工具建议(按可用性选择)
- **PDF**
- `pdftotext`(poppler):快速提取文本型 PDF
- `pdfplumber`:精细表格与版面提取
- `PyMuPDF` (fitz):高性能文本 / 图片 / 元数据
- **Word**
- `python-docx`:段落、表格、样式
- **Excel**
- `openpyxl`:单元格级读写
- `pandas`:表格批量转 DataFrame
- **图片 OCR**
- `Tesseract`(pytesseract):通用 OCR
- `PaddleOCR`:中文与复杂版面效果更佳
> 使用前先检测工具是否已安装(`which` / `python -c "import …"`),缺失时提示安装或回退方案。
## 结构化输出
输出建议采用 JSON 或 Markdown,按以下结构组织:
- `paragraphs`:段落文本列表
- `tables`:表格(二维数组 / Markdown 表格)
- `key_values`:键值对(适用于表单、凭证)
- `metadata`:文件名、页数、解析工具、时间
## 表格与版面理解要点
- 优先保留表格的行列结构,避免拍平为纯文本
- 注意合并单元格、跨页表格的还原
- 多栏版面需按阅读顺序重组,避免串列
- 表头识别:首行 / 合并单元格常为表头
## 注意事项
- **扫描件 PDF**:文本层为空,需走 OCR 流程(先转图片再识别)
- **加密 / 受保护文件**:需先解密或取得口令,否则无法解析
- **多语言**:中文优先 PaddleOCR;Tesseract 需安装对应语言包(如 `chi_sim`)
- **乱码**:检查文件编码与字体嵌入,必要时用 OCR 兜底
- **大文件**:分页 / 分块处理,避免一次性载入内存溢出
## 输出校验
- 核对页数、段落数、表格数是否与原文一致
- 抽样比对关键文本,确认无错行 / 漏行
- 对 OCR 结果保留置信度,低置信片段标记复核
## 脚本说明
本工具自带脚本,位于 `scripts/` 下,按需安装依赖后即可运行:
| 文件 | 作用 |
| --- | --- |
| `scripts/parse.py` | 解析主脚本:自动识别 PDF/Word/Excel/图片,统一输出 JSON(paragraphs/tables/key_values/metadata) |
| `scripts/requirements.txt` | 依赖清单(按实际用到的文档类型按需安装) |
### 安装与用法
```bash
# 按需安装依赖(解析哪类装哪类)
pip install -r scripts/requirements.txt
# OCR 还需系统安装 Tesseract 引擎,中文需 chi_sim 语言包
# 自动识别类型并解析,结果输出到 stdout(JSON)
python scripts/parse.py --input 报销台账.xlsx
# 指定类型 + 输出到文件
python scripts/parse.py --input 发票.pdf --type pdf --output result.json
# OCR 解析扫描件 / 图片
python scripts/parse.py --input 扫描发票.png --type ocr
```
输出 JSON 结构:
```json
{
"metadata": {"file": "...", "type": "...", "tool": "...", "pages": 3},
"paragraphs": ["..."],
"tables": [[...]],
"key_values": {"k": "v"}
}
```
缺哪种依赖会明确提示安装命令;脚本优先用已安装的库(如 PDF 优先 PyMuPDF,回退 pdftotext)。
Files in this package (3)
- SKILL.md 4 KB
- scripts/parse.py 5 KB
- scripts/requirements.txt 1 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · auditaih/audit-tool-skills | 96 | MIT |
| Amey-Thakur/AI-SKILLS | 90 | MIT |
| agentbody/skills | 90 | MIT |
Database snapshot: 13.11.2026 · package version 68fd8505f826 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 1 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100document-processing
This skill should be used when the user says \"process documents\", \"extract text from PDF\", \"OCR this document\", \"convert PDF to markdown\", \"extract emails from documents\", \"parse document\", \"document conversion\", \"batch OCR\", \"extract structured data from PDF\",… - 100reducto-document-parsing
This skill should be used when the user asks to "parse a document", "extract data from PDF", "process invoices", "convert PDF to markdown", "extract structured data", "edit a document", mentions "reducto", or discusses document processing, OCR, PDF parsing, invoice extraction,… - 100compdf-conversion-cli
MUST use for ANY PDF or image format conversion task — converting PDF and images (JPG/JPEG/PNG/BMP/TIFF/TIF/WEBP/JPEG2000) to 10 formats (Word, Excel, PPT, HTML, Image, TXT, JSON, Markdown, RTF, CSV) with AI layout analysis and OCR support. This skill takes PRIORITY over pdf,… - 90doc-processor
当用户要生成 Word/Excel/PowerPoint、做文档格式转换(Markdown ↔ HTML ↔ DOCX ↔ PDF)、PDF 文本提取、读写 Excel、合并文档或批量转换时使用。 - 95markitdown
Convert local documents to Markdown using Microsoft's markitdown CLI. Best for: PDF, Word, Excel, PowerPoint, images (OCR), audio. Can fetch URLs but Jina is faster for web. Triggers on: convert to markdown, read PDF, parse document, extract text from, docx, xlsx, pptx, OCR image, local file. - 87tianbiao
Template-preserving form/report filler. Extracts text from mixed reference materials (PDF/OCR/images/Office), corrects misaligned lines and OCR errors, then fills the content into a Word/Excel template while keeping the ORIGINAL fonts, borders, merged cells and layout — never…