Metadata-Version: 2.4
Name: markitai
Version: 0.3.0
Summary: Document to Markdown converter with LLM enhancement
Project-URL: Homepage, https://markitai.ynewtime.com
Project-URL: Documentation, https://markitai.ynewtime.com/guide/getting-started
Project-URL: Repository, https://github.com/Ynewtime/markitai
Project-URL: Changelog, https://github.com/Ynewtime/markitai/blob/main/CHANGELOG.md
Author-email: Ynewtime <longqiliuye@gmail.com>
License-Expression: MIT
Keywords: converter,docx,llm,markdown,ocr,pdf
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Text Processing :: Markup :: Markdown
Classifier: Topic :: Utilities
Requires-Python: >=3.11
Requires-Dist: aiofiles>=25.1.0
Requires-Dist: click>=8.1.0
Requires-Dist: instructor>=1.14.0
Requires-Dist: litellm>=1.80.16
Requires-Dist: loguru>=0.7.3
Requires-Dist: markitdown[all]>=0.1.4
Requires-Dist: pillow>=12.1.0
Requires-Dist: pydantic>=2.10.0
Requires-Dist: pymupdf4llm>=0.2.9
Requires-Dist: python-dotenv>=1.2.1
Requires-Dist: pywin32>=310; sys_platform == 'win32'
Requires-Dist: rapidocr>=3.5.0
Requires-Dist: rich>=14.2.0
Provides-Extra: all
Description-Content-Type: text/markdown

# Markitai

开箱即用的 Markdown 转换器，原生支持 LLM 增强。

## 特性

- **多格式支持** - DOCX/DOC, PPTX/PPT, XLSX/XLS, PDF, TXT, MD, JPG/PNG/WebP, URLs
- **LLM 增强** - 格式清洗、元数据生成、图片分析
- **批量处理** - 并发转换、断点恢复、进度显示
- **OCR 识别** - 扫描版 PDF 和图片文字提取
- **URL 转换** - 直接转换网页，支持 SPA 浏览器渲染

## 安装

### 一键安装（推荐）

```bash
# Linux/macOS
curl -fsSL https://raw.githubusercontent.com/Ynewtime/markitai/main/scripts/setup.sh | sh

# Windows (PowerShell)
irm https://raw.githubusercontent.com/Ynewtime/markitai/main/scripts/setup.ps1 | iex
```

### 手动安装

```bash
# 需要 Python 3.11+
uv tool install markitai

# 或使用 pip
pip install --user markitai
```

## 快速开始

```bash
# 基础转换
markitai document.docx

# URL 转换
markitai https://example.com/article

# LLM 增强
markitai document.docx --llm

# 使用预设
markitai document.pdf --preset rich      # LLM + alt + desc + screenshot
markitai document.pdf --preset standard  # LLM + alt + desc
markitai document.pdf --preset minimal   # 仅基础转换

# 批量处理
markitai ./docs -o ./output

# 断点恢复
markitai ./docs -o ./output --resume

# URL 批量处理（自动识别 .urls 文件）
markitai urls.urls -o ./output
```

## 输出结构

```
output/
├── document.docx.md        # 基础 Markdown
├── document.docx.llm.md    # LLM 优化版
├── assets/
│   ├── document.docx.0001.jpg
│   └── images.json         # 图片描述
├── screenshots/            # 页面截图（--screenshot 时）
│   └── example_com.full.jpg
```

## 配置

优先级：命令行 > 环境变量 > 配置文件 > 默认值

```bash
# 查看配置
markitai config list

# 初始化配置文件
markitai config init -o .

# 查看缓存状态
markitai cache stats

# 清理缓存
markitai cache clear
```

配置文件路径：`./markitai.json` 或 `~/.markitai/config.json`

## 环境变量

| 变量 | 说明 |
|------|------|
| `OPENAI_API_KEY` | OpenAI API Key |
| `GEMINI_API_KEY` | Google Gemini API Key |
| `DEEPSEEK_API_KEY` | DeepSeek API Key |
| `ANTHROPIC_API_KEY` | Anthropic API Key |
| `JINA_API_KEY` | Jina Reader API Key（URL 转换） |

## 依赖

- [pymupdf4llm](https://github.com/pymupdf/RAG) - PDF 转换
- [markitdown](https://github.com/microsoft/markitdown) - Office 文档和 URL 转换
- [LiteLLM](https://github.com/BerriAI/litellm) - LLM 网关
- [RapidOCR](https://github.com/RapidAI/RapidOCR) - OCR 识别

## 文档

- [快速开始](https://ynewtime.github.io/markitai/guide/getting-started)
- [配置说明](https://ynewtime.github.io/markitai/guide/configuration)
- [CLI 命令参考](https://ynewtime.github.io/markitai/guide/cli)

## License

MIT
