Skip to main content

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

Project description

ieeU - 图片描述替换工具

PyPI Version Python Version License

将MinerU转换后的Markdown文件中的图片链接替换为VLM生成的描述性文本。

安装

pip install ieeU

或从源码安装:

pip install -e .

使用

命令行接口

ieeU --help          # 显示帮助信息
ieeU --version       # 显示版本号
ieeU run             # 执行图片描述转换
ieeU run --verbose   # 详细输出模式

配置文件

~/.ieeU/settings.json 中配置API:

{
    "endpoint": "https://openrouter.ai/api/v1/chat/completions",
    "key": "your-api-key",
    "modelName": "google/gemini-3-flash-preview",
    "timeout": 120,
    "retries": 3,
    "maxConcurrency": 3
}

必填项

  • endpoint: API端点URL
  • key: API密钥
  • modelName: 模型名称

可选项

  • timeout: 请求超时(秒),默认60
  • retries: 重试次数,默认3
  • maxConcurrency: 最大并发数,默认5

环境变量

可覆盖配置:

  • IEEU_ENDPOINT
  • IEEU_KEY
  • IEEU_MODEL

示例

在包含 full.md 的目录中运行:

ieeU run

处理前:

![](images/figure1.jpg)
Figure 1 shows the architecture.

处理后:

```figure 1
This figure illustrates the overall architecture of the system...
```
Figure 1 shows the architecture.

开发

安装开发依赖

pip install -e ".[dev]"

运行测试

pytest tests/

构建发布包

pip install build
python -m build
twine check dist/*

发布到PyPI

  1. 安装构建工具:

    pip install build twine
    
  2. 构建包:

    python -m build
    
  3. 发布到Test PyPI(测试):

    twine upload --repository testpypi dist/*
    
  4. 发布到PyPI:

    twine upload dist/*
    

或使用GitHub Actions自动发布:

  1. 创建PyPI API Token
  2. 添加到GitHub Secrets: PYPI_API_TOKEN
  3. 创建Release并发布

支持的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.0.4.tar.gz (10.4 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.0.4-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ieeu-1.0.4.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ieeu-1.0.4.tar.gz
Algorithm Hash digest
SHA256 bb4741db8ac44851f5a31186b77869964ef54f70e1ac1dd72e6d43629a6b8ea0
MD5 f5cc3bc17c1eefe02ee7aec32ad12d12
BLAKE2b-256 cfb8d90cde39704aa0552449b9fdc04919d6e8c1f1aa872419a1559c5bc4b67c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ieeu-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 10.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ieeu-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a0643fd7bbc9c159cc71f973d0318d3dbb8b50bda49f8a012e28090685eb2862
MD5 aff3a9c0752ba032c780d083f842fee4
BLAKE2b-256 971c3e3f4b398d6f6da50391b87de742aeaa38f7e6859dfb1a143da2b991288d

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