agentsclimarketplace

Pdf batch

Skill MrSGSA/math-modeling-skill-dify/.agents/skills/math-modeling/tools/pdf-batch

可直接拖入工作目录的数学建模Agent Skill与Dify九库多模态MCP桥,支持Codex、Claude Code及其他Agent

Install
npx -y skills add MrSGSA/math-modeling-skill-dify --skill pdf-batch

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 14 days oldThe repository was created 14 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
  • 4 stars4 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

批量把含正文、表格、数学公式和图片的 PDF、DOCX、PPTX、XLSX 与图片转换为 Dify 文本库 Markdown 和多模态图片检索包。用户要求一键转换论文、OCR 扫描件、保留 LaTeX 公式/原图或生成批量转换清单时使用。

SKILL.md

2.5 KB, 739 tokens by cl100k_base, as published. Nobody here has run it

文档批量转 Markdown

调用 scripts/batch_convert.py 和 MinerU。保持输入文档只读,将结果写入 PROJECT_ROOT。旧式 .doc 先转换为 .docx

环境与运行

MinerU 在 Windows 上要求 Python 3.10 至 3.12。本机默认 Python 可以用于启动批处理,但 MinerU 应使用 uv 建立的独立 Python 3.12 工具环境:

uv tool install --python 3.12 "mineru[all]"

安装体积较大,未经用户同意不要自动安装或下载模型。在 PROJECT_ROOT 中运行:

python <SKILL_ROOT>\tools\pdf-batch\scripts\batch_convert.py --input knowledge_inbox\pdf --output knowledge_ready

默认使用支持纯 CPU 的 pipeline 后端。可用 --backend auto 切换默认后端,--dry-run 只检查计划,--force 强制重新转换。

推荐单次高精度转换同时生成文本库与图片库成品:

python <SKILL_ROOT>\tools\pdf-batch\scripts\batch_convert.py --input <文档目录> --output <多模态包目录> --markdown-output <Markdown目录> --backend auto --effort high --image-analysis --dify-multimodal

此模式对每份文档只调用一次 MinerU,同时发布:

  • 纯 Markdown:保留公式和图表分析文字、移除无法上传的本地图片链接,用于现有文本知识库。
  • .dify-mm.zip:包含 manifest.jsondocument.md 和唯一命名的原图,用于配套 Dify 插件和统一多模态图片库。该包只索引含图片的块,正文仍由文本库负责。

只有两份成品都存在且不早于源文档时才跳过。中间 JSON、布局结果和临时目录在单篇完成后自动清理。

只需要一个 Markdown 时仍可使用 --md-only

输出与检查

  • 图片名包含源文档哈希、图序号和图片哈希;插件再按清单路径与 SHA-256 校验,避免跨论文串图。
  • 同名且同扩展名的源文档会在输出名中加入内容哈希,避免覆盖。
  • batch_report.json 记录源文件 SHA-256、命令、状态、耗时和输出。
  • dify_upload_list.txt 列出成功生成的 Markdown,供用户手动上传。
  • conversion.log 保存每篇文档的 MinerU 输出。

重复运行时跳过未变化且两份成品均已存在的文件。文本 Markdown 上传普通知识库;.dify-mm.zip 只上传统一多模态图片库。

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.