lyxy-document-reader

统一文档解析工具 - 将 DOC、DOCX、XLS、XLSX、PPT、PPTX、PDF、HTML/URL 转换为 Markdown。支持全文输出、字数统计、行数统计、标题提取、章节提取、正则搜索。当用户要求"读取/解析/打开文档"、上传 .doc/.docx/.xls/.xlsx/.ppt/.pptx/.pdf/.html 文件、或提供 URL 时使用。

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "lyxy-document-reader" with this command: npx skills add lanyuanxiaoyao/skills/lanyuanxiaoyao-skills-lyxy-document-reader

统一文档解析 Skill

🔴 重要:执行路径优先级(必须遵守)

执行路径选择(按优先级顺序)

  1. lyxy-runner-python skill(首选) - 自动管理依赖
  2. python scripts/lyxy_document_reader.py - 自启动,自动检测依赖
  3. uv run --with - 手动指定依赖
  4. 主机 Python + pip install - 手动安装依赖

推荐用法

# 直接运行(自动检测依赖并执行)
python scripts/lyxy_document_reader.py <文件路径或URL>

脚本会自动检测文件类型、当前平台,并用正确的 uv 命令执行。

Purpose

支持格式

  • DOC(Word 旧格式)
  • DOCX(Word 文档)
  • XLS(Excel 旧格式)
  • XLSX(Excel 表格)
  • PPT(PowerPoint 旧格式)
  • PPTX(PowerPoint 演示文稿)
  • PDF(PDF 文档,支持 OCR)
  • HTML / URL(网页内容)

When to Use

触发场景

  • 文档转换:将各类文档转为 Markdown
  • 文档元数据:字数、行数统计
  • 标题分析:提取标题结构
  • 章节提取:提取特定章节
  • 内容搜索:关键词或正则搜索

触发词

  • 中文:"读取/解析/打开 文档/Word/Excel/PPT/PDF/网页"
  • 英文:"read/parse/extract document/doc/docx/xls/xlsx/ppt/pptx/pdf/html"
  • 文件扩展名:.doc.docx.xls.xlsx.ppt.pptx.pdf.html.htm
  • URL:http://https://

Quick Reference

参数说明
(无)输出完整 Markdown
-c/--count字数统计
-l/--lines行数统计
-t/--titles提取所有标题(1-6级)
-tc <name>提取指定标题的章节内容
-s <pattern>正则表达式搜索
-n <num>/--context <num>-s 配合,指定上下文行数(默认 2)

参数使用示例

# 读取全文(自动检测依赖)
python scripts/lyxy_document_reader.py document.docx

# 统计字数
python scripts/lyxy_document_reader.py document.docx -c

# 提取标题
python scripts/lyxy_document_reader.py document.docx -t

# 提取指定章节
python scripts/lyxy_document_reader.py document.docx -tc "第三章"

# 搜索内容
python scripts/lyxy_document_reader.py document.docx -s "关键词"

# 正则搜索
python scripts/lyxy_document_reader.py document.docx -s "\d{4}-\d{2}-\d{2}"

# 指定搜索上下文行数
python scripts/lyxy_document_reader.py document.docx -s "关键词" -n 5

错误处理

错误原因解决
错误: input_path 不能为空未提供输入提供 file_path 或 URL
错误: 不支持的文件类型无对应 reader检查文件扩展名
所有解析方法均失败所有解析器失败检查文件是否损坏
错误: 无效的正则表达式正则语法错误检查正则语法
错误: 未找到匹配搜索无结果检查搜索词或正则
ModuleNotFoundError缺少依赖脚本会自动检测并安装依赖

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

nano-banana-2

Nano Banana 2 - Gemini 3.1 Flash Image Preview

Repository Source
65.5K159inferen-sh
General

qwen-image-2

Qwen-Image - Alibaba Image Generation

Repository Source
65.2K159inferen-sh
General

p-video

Pruna P-Video Generation

Repository Source
65.2K159inferen-sh
General

qwen-image-2-pro

Qwen-Image Pro - Professional Image Generation

Repository Source
65.1K159inferen-sh