Metadata-Version: 2.4
Name: openrehab-pdf
Version: 0.1.0
Summary: OpenRehab PDF to Markdown conversion tool for rehabilitation medicine research
Home-page: https://github.com/Drehabwen/Openrehab-vibepaper-read
Author: Drehabwen
Author-email: Drehabwen <drehabwen@example.com>
License: MIT
Project-URL: Homepage, https://github.com/Drehabwen/Openrehab-vibepaper-read
Project-URL: Documentation, https://github.com/Drehabwen/Openrehab-vibepaper-read#readme
Project-URL: Repository, https://github.com/Drehabwen/Openrehab-vibepaper-read
Keywords: pdf,markdown,rehabilitation,medical,academic,papers,openrehab
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Healthcare Industry
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Topic :: Text Processing
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyMuPDF>=1.23.0
Requires-Dist: pdfplumber>=0.10.0
Requires-Dist: PyYAML>=6.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"
Requires-Dist: black>=23.0; extra == "dev"
Requires-Dist: flake8>=6.0; extra == "dev"
Dynamic: author
Dynamic: home-page
Dynamic: license-file
Dynamic: requires-python

# OpenRehab PDF

[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

**OpenRehab PDF** - 康复医学研究 PDF 转 Markdown 工具

OpenRehab 生态系统的一部分，专注于康复医学文献的数字化处理。

## ✨ 特性

- 📄 **PDF 文本提取** - 基于 PyMuPDF 的高效文本提取
- 📊 **表格提取** - 使用 pdfplumber 提取 PDF 表格
- 🔄 **批量处理** - 支持批量转换多个 PDF 文件
- 🤖 **AI 格式化** - 配合 markdown-formatter skill 智能格式化
- 📦 **Python 包** - 可通过 pip 安装使用
- 🛠️ **CLI 工具** - 提供命令行接口
- 🏥 **康复医学专用** - 针对医学文献优化

## 📦 安装

```bash
pip install openrehab-pdf
```

或从源码安装：

```bash
git clone https://github.com/Drehabwen/Openrehab-vibepaper-read.git
cd Openrehab-vibepaper-read
pip install -e .
```

## 🚀 快速开始

### 命令行使用

```bash
# 转换单个 PDF
openrehab-pdf convert paper.pdf

# 批量转换
openrehab-pdf batch ./pdfs -o ./output

# 使用配置文件
openrehab-pdf batch ./pdfs -c config.yaml
```

### Python API 使用

```python
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` 文件：

```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` | 摘要生成 | 🔜 规划中 |

## 📝 使用示例

### 转换康复医学论文

```python
from openrehab_pdf import convert_pdf

# 转换 PDF 论文
convert_pdf(
    "moxibustion_fatigue.pdf",
    "moxibustion_fatigue.md",
    extractor="pymupdf"
)
```

### 批量处理

```python
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](LICENSE) 文件

## 🤝 贡献

欢迎提交 Issue 和 Pull Request！

## 📮 联系方式

- GitHub: https://github.com/Drehabwen/Openrehab-vibepaper-read

---

**OpenRehab** - 让康复医学知识更易获取 🏥

**Made with ❤️ by Drehabwen**
