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-2.0.0.tar.gz (18.1 kB view details)

Uploaded Source

Built Distribution

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

ieeu-2.0.0-py3-none-any.whl (16.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for ieeu-2.0.0.tar.gz
Algorithm Hash digest
SHA256 cda0a69bf70d4f847ba795c85b23396a64f2ff8b3f6b7cf73fbdc69f2147476a
MD5 567265f6b4ec619ef15cca16a8274b67
BLAKE2b-256 1e28cd1e457448107cb164bb65447547a8e38bb7c1d1f5294657a674cc4a8b32

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for ieeu-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b38ee686ca986c1d25a4475f2dcbd0e7a4954411744b5d2ba4643b2a6fd4514b
MD5 4d93b6ed73c662160bcd0d348547243b
BLAKE2b-256 b07842a09029f5cb4408b0e7fb6b0983a7bc6c47a25e7f90598a0e9db04b6ed6

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