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
Metadata
Release files for openrehab-pdf 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| openrehab_pdf-0.1.0.tar.gz | 12.2 kB | Without provenance | Details for openrehab_pdf-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| openrehab_pdf-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for openrehab_pdf-0.1.0-py3-none-any.whl |
Total release size: 23.3 kB
Release files / openrehab_pdf-0.1.0.tar.gz
| Download URL | openrehab_pdf-0.1.0.tar.gz |
|---|---|
| Size | 12.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
baa3f9f46d3aad1df8cf27a5d6ffd08e56f357ba8936c398a6ca195e781a9cde
|
|
BLAKE2b-256 checksum How to use checksums |
43dfc6bad96ac571979ff04df54ca838fe28c84898bd3701f4bd792dc5585aa2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / openrehab_pdf-0.1.0-py3-none-any.whl
| Download URL | openrehab_pdf-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4912ee560ccbd4032440da62e08b7d85759e1eeb6526147c9ba4e28631063c6e
|
|
BLAKE2b-256 checksum How to use checksums |
bef60e31368214a27f4bd3089077d83df0b0f3e3ec2c27a573c78f194e025ed4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Security for openrehab-pdf 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.