Skip to main content

将Markdown中的图片链接替换为VLM生成的描述性文本

Project description

ieeU - PDF智能解析工具

PyPI Version Python Version License

一键将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_ENDPOINT
  • IEEU_KEY
  • IEEU_MODEL
  • IEEU_MINERU_TOKEN

输出示例

处理前(PDF中的图片):

![](images/figure1.jpg)
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-1.2.1.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ieeu-1.2.1-py3-none-any.whl (13.5 kB view details)

Uploaded Python 3

File details

Details for the file ieeu-1.2.1.tar.gz.

File metadata

  • Download URL: ieeu-1.2.1.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for ieeu-1.2.1.tar.gz
Algorithm Hash digest
SHA256 1a661b8281eaf482b1d683855c50e944cba01a0a7326f5280bfb11f6353d0ee8
MD5 b925d786fa5e4d646c7fc307a27cd9d9
BLAKE2b-256 4d5b57e8ec3c0d833300f352846684ed13d2cce795a2f7d2ddd8ed44b5ef97b4

See more details on using hashes here.

File details

Details for the file ieeu-1.2.1-py3-none-any.whl.

File metadata

  • Download URL: ieeu-1.2.1-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.2

File hashes

Hashes for ieeu-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2a6551accf144d5eddf0af2f9401c8109bfdc770dc8068aad2b22c662da91389
MD5 d4ce1cbfe1953a318f3da6fe63006110
BLAKE2b-256 d867828943c6df75e13edeca32aa1b99af8a90264ec1b4a52a03e1b2b9588ca8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page