将Markdown中的图片链接替换为VLM生成的描述性文本
Project description
ieeU - PDF智能解析工具
一键将PDF文件解析为Markdown,并使用VLM将图片替换为描述性文本。
功能特性
- PDF解析:调用MinerU云端API将PDF转换为Markdown
- 图片描述:使用VLM(视觉语言模型)生成图片的文字描述
- 一键处理:单条命令完成PDF→Markdown→图片描述替换的完整流程
安装
pip install ieeU
或从源码安装:
pip install -e .
快速开始
1. 配置API
在 ~/.ieeU/settings.json 中配置:
{
"endpoint": "https://openrouter.ai/api/v1/chat/completions",
"key": "your-vlm-api-key",
"modelName": "google/gemini-3-flash-preview",
"mineruToken": "your-mineru-token"
}
获取 MinerU Token:访问 mineru.net 注册并获取API Token。
2. 处理PDF
ieeU process paper.pdf
输出:paper.md(与PDF同目录)
命令行接口
ieeU --help # 显示帮助信息
ieeU --version # 显示版本号
# 主要命令:处理PDF文件
ieeU process paper.pdf # 处理PDF,输出到同目录
ieeU process paper.pdf -o ./output # 指定输出目录
ieeU process paper.pdf --verbose # 详细输出模式
# 向后兼容:处理已有的Markdown文件
ieeU run # 处理当前目录的full.md文件
ieeU run --verbose # 详细输出模式
配置文件
必填项
| 字段 | 说明 |
|---|---|
endpoint |
VLM API端点URL |
key |
VLM API密钥 |
modelName |
VLM模型名称 |
mineruToken |
MinerU API Token(process命令必需) |
可选项
| 字段 | 说明 | 默认值 |
|---|---|---|
timeout |
请求超时(秒) | 60 |
retries |
重试次数 | 3 |
maxConcurrency |
最大并发数 | 5 |
环境变量
可覆盖配置文件:
IEEU_ENDPOINTIEEU_KEYIEEU_MODELIEEU_MINERU_TOKEN
输出示例
处理前(PDF中的图片):

Figure 1 shows the architecture.
处理后:
```figure 1
This figure illustrates the overall architecture of the system,
showing three main components connected by data flow arrows...
```
Figure 1 shows the architecture.
开发
安装开发依赖
pip install -e ".[dev]"
运行测试
pytest tests/
构建发布包
pip install build
python -m build
twine check dist/*
发布到PyPI
# 构建
python -m build
# 发布
twine upload dist/*
支持的VLM
- OpenAI GPT-4V
- Google Gemini (via OpenRouter)
- Anthropic Claude (via OpenRouter)
- 其他OpenAI兼容的API
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ieeu-2.1.0.tar.gz
(18.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
ieeu-2.1.0-py3-none-any.whl
(17.1 kB
view details)
File details
Details for the file ieeu-2.1.0.tar.gz.
File metadata
- Download URL: ieeu-2.1.0.tar.gz
- Upload date:
- Size: 18.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2b10a79fbb6348ae1f686c302e5ae5fc048582dd2d9ddaa984e2241b303c52cb
|
|
| MD5 |
3101160ec6a0b65295a304e4ba93c8a5
|
|
| BLAKE2b-256 |
f4d12b576f80e5f1b5808722549ec2de7d31a233912c0afd497a8a9312bd2d98
|
File details
Details for the file ieeu-2.1.0-py3-none-any.whl.
File metadata
- Download URL: ieeu-2.1.0-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5edae987db6316f755b41e0ba1453361f9e0d69d100524167410ad9533405e1c
|
|
| MD5 |
3c0e2573d7a7f59e8e1c6880f2223c69
|
|
| BLAKE2b-256 |
2689e09b69b474f8900f9bde003361cf454cd121f621de1f1b89b0a7b19feab9
|