OpenRehab PDF to Markdown conversion tool for rehabilitation medicine research
Project description
OpenRehab PDF
OpenRehab PDF - 康复医学研究 PDF 转 Markdown 工具
OpenRehab 生态系统的一部分,专注于康复医学文献的数字化处理。
✨ 特性
- 📄 PDF 文本提取 - 基于 PyMuPDF 的高效文本提取
- 📊 表格提取 - 使用 pdfplumber 提取 PDF 表格
- 🔄 批量处理 - 支持批量转换多个 PDF 文件
- 🤖 AI 格式化 - 配合 markdown-formatter skill 智能格式化
- 📦 Python 包 - 可通过 pip 安装使用
- 🛠️ CLI 工具 - 提供命令行接口
- 🏥 康复医学专用 - 针对医学文献优化
📦 安装
pip install openrehab-pdf
或从源码安装:
git clone https://github.com/Drehabwen/Openrehab-vibepaper-read.git
cd Openrehab-vibepaper-read
pip install -e .
🚀 快速开始
命令行使用
# 转换单个 PDF
openrehab-pdf convert paper.pdf
# 批量转换
openrehab-pdf batch ./pdfs -o ./output
# 使用配置文件
openrehab-pdf batch ./pdfs -c config.yaml
Python API 使用
from openrehab_pdf import convert_pdf, Config
# 简单转换
convert_pdf("paper.pdf", "output.md")
# 使用配置
config = Config.from_yaml("config.yaml")
convert_pdf("paper.pdf", "output.md", config=config)
📁 项目结构
openrehab_pdf/
├── __init__.py # 包入口
├── cli.py # 命令行接口
├── config.py # 配置管理
├── extractors.py # PDF 提取器
├── formatter.py # Markdown 格式化
└── processor.py # 批量处理器
⚙️ 配置
创建 config.yaml 文件:
input_directories:
- "./pdfs"
output_directory: "./output"
extractor: "pymupdf" # pymupdf 或 pdfplumber
preserve_images: true
🔧 依赖
- Python >= 3.8
- PyMuPDF >= 1.23.0
- pdfplumber >= 0.10.0
- PyYAML >= 6.0
🏥 OpenRehab 生态系统
OpenRehab 是一个开源康复医学研究平台,包含以下组件:
| 包名 | 功能 | 状态 |
|---|---|---|
openrehab-pdf |
PDF 转 Markdown | ✅ 已发布 |
openrehab-dataset |
数据清洗 | 🔜 开发中 |
openrehab-formatter |
格式化工具 | 🔜 规划中 |
openrehab-translate |
论文翻译 | 🔜 规划中 |
openrehab-summarize |
摘要生成 | 🔜 规划中 |
📝 使用示例
转换康复医学论文
from openrehab_pdf import convert_pdf
# 转换 PDF 论文
convert_pdf(
"moxibustion_fatigue.pdf",
"moxibustion_fatigue.md",
extractor="pymupdf"
)
批量处理
from openrehab_pdf import PDFProcessor, Config
config = Config(
input_directories=["./papers"],
output_directory="./markdown"
)
processor = PDFProcessor(config)
processor.process_all()
🤝 配合 AI 格式化
本项目提供 markdown-formatter skill,可以配合 AI 工具进行智能格式化:
用户: 整理这个 Markdown 文件
AI: [调用 markdown-formatter skill 进行格式化]
📄 License
MIT License - 详见 LICENSE 文件
🤝 贡献
欢迎提交 Issue 和 Pull Request!
📮 联系方式
OpenRehab - 让康复医学知识更易获取 🏥
Made with ❤️ by Drehabwen
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
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
File details
Details for the file openrehab_pdf-0.1.0.tar.gz.
File metadata
- Download URL: openrehab_pdf-0.1.0.tar.gz
- Upload date:
- Size: 12.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baa3f9f46d3aad1df8cf27a5d6ffd08e56f357ba8936c398a6ca195e781a9cde
|
|
| MD5 |
8ca3e8f739cac0496353bfe5654ed6b3
|
|
| BLAKE2b-256 |
43dfc6bad96ac571979ff04df54ca838fe28c84898bd3701f4bd792dc5585aa2
|
File details
Details for the file openrehab_pdf-0.1.0-py3-none-any.whl.
File metadata
- Download URL: openrehab_pdf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4912ee560ccbd4032440da62e08b7d85759e1eeb6526147c9ba4e28631063c6e
|
|
| MD5 |
0909460adcab598be5ed2668ab460151
|
|
| BLAKE2b-256 |
bef60e31368214a27f4bd3089077d83df0b0f3e3ec2c27a573c78f194e025ed4
|