读取和编辑 Word、PDF、Excel 文档。使用 python-docx、pdfplumber、openpyxl

GitHub
安装命令
npx skhub add bighardperson/doc-handler
Markdown
SKILL.md

doc-handler - 文档处理工具

功能

功能命令
读取 Wordpython3 -m doc_handler read docx 文件
读取 PDFpython3 -m doc_handler read pdf 文件
读取 Excelpython3 -m doc_handler read xlsx 文件
写入 Wordpython3 -m doc_handler write docx 文件 "内容"

使用示例

# 读取 Word 文档
python3 -c "from docx import Document; d = Document('file.docx'); print('\\n'.join([p.text for p in d.paragraphs]))"

# 读取 PDF
python3 -c "import pdfplumber; with pdfplumber.open('file.pdf') as pdf: print(pdf.pages[0].extract_text())"

# 读取 Excel
python3 -c "import pandas; df = pandas.read_excel('file.xlsx'); print(df)"

依赖

  • python-docx
  • pdfplumber
  • openpyxl
  • pandas
发现
标签

此技能尚未发布标签。

版本
最新版本元数据

版本

v2026.09.24

发布时间

2026年9月24日

分类

未分类

许可证

NOASSERTION

源路径

skills/doc-handler

默认分支

main

最新提交

e9f99fd

Tree SHA

de4405f