ppt-readers

👤 @ 📦 v1.0.0
Deprecated: number_format(): Passing null to parameter #1 ($num) of type float is deprecated in D:\7W4\0网站PHP源码\网站PHP\public\skill.php on line 79
0.0
⬇️ 344 下载
📄 办公效率 免费

📖 技能介绍

pptx-reader

读取 .pptx 文件内容,提取文本、表格、备注、图片统计。纯标准库实现,无需第三方依赖。

触发条件

用户要求读取/查看/解析 PPT/PPTX 文件内容时自动加载。

核心要点

环境要求

  • 无需安装任何包,使用 Python 标准库(zipfile + xml.etree.ElementTree)
  • 推荐 Python/usr/bin/python3(系统自带,避免沙箱 lxml 签名问题)
  • ⚠️ 不要用 python-pptx:沙箱环境下 lxml 的 .so 文件有 code signature 问题,ImportError: dlopen ... different Team IDs

运行方式

/usr/bin/python3 ~/.workbuddy/skills/pptx-reader/read_pptx.py "<FILE_PATH>"

脚本位置

~/.workbuddy/skills/pptx-reader/read_pptx.py

输出格式

  • 文件名、幻灯片总数
  • 每页幻灯片的文本内容(保留缩进层级)
  • 表格内容(| 分隔格式)
  • 图片数量统计
  • 备注页内容

注意事项

  • 仅处理 .pptx 格式(Office 2007+),不支持旧版 .ppt
  • 命名空间关键点:p:txBody 在 presentationml 命名空间,a:p / a:t 在 drawingml 命名空间
  • 对于含大量图片的 PPT,脚本只能统计图片数量,无法提取图片内容
  • 若文件路径含空格,需用引号包裹
  • Read 工具对 .pptx 文件返回 "Cannot display content of binary file",必须用此脚本

📁 包含文件 (2 个)

📄 SKILL.md 1.3 KB
📄 read_pptx.py 5.1 KB

🔥 大家都在搜

wps 写作 pdf 苹果