Mineru pdf

From malue-ai/dazee-small · View interactive version

Mineru pdf is an AI agent skill from the GitHub repository malue-ai/dazee-small. Parse PDF documents locally into structured Markdown/JSON using MinerU. CPU-only, privacy-first.

How to use this skill

Skill file

MinerU PDF 解析

本地解析 PDF 文档为结构化 Markdown 或 JSON,保留标题层级、表格、列表等结构。CPU 运行,数据不出本机。

使用场景

与其他 PDF 处理 Skill 的区别

| 工具 | 擅长 | 局限 |

|---|---|---|

| nano-pdf | 简单文本提取、PDF 元数据 | 不保留结构 |

| pdf-toolkit | 合并/拆分/加密/水印 | 不做内容解析 |

| mineru-pdf | 结构化解析(标题/表格/列表) | 安装包较大 |

优先使用 mineru-pdf 做内容提取,pdf-toolkit 做文件操作。

执行方式

安装

pip install magic-pdf

基本用法

magic-pdf -p /path/to/document.pdf -o /path/to/output/ -m auto

参数说明:

Python API

from magic_pdf.data.data_reader_writer import FileBasedDataWriter, FileBasedDataReader
from magic_pdf.pipe.UNIPipe import UNIPipe

reader = FileBasedDataReader("")
writer = FileBasedDataWriter(output_dir)

pdf_bytes = reader.read(pdf_path)
pipe = UNIPipe(pdf_bytes, model_list=[], image_writer=writer)
pipe.pipe_classify()
pipe.pipe_analyze()
pipe.pipe_parse()
md_content = pipe.pipe_mk_markdown(image_dir, drop_mode="none")

输出内容

解析后在输出目录生成:

输出规范

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.