Metadata-Version: 2.4
Name: rapiddoc-cli
Version: 0.1.1
Summary: CLI for RapidAI/RapidDoc — parse PDF/Office documents to Markdown/JSON/Word/HTML
Project-URL: Homepage, https://github.com/1WorldCapture/rapiddoc-cli
Project-URL: Repository, https://github.com/1WorldCapture/rapiddoc-cli
Project-URL: Issues, https://github.com/1WorldCapture/rapiddoc-cli/issues
Author: 1WorldCapture
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: cli,document-parsing,markdown,ocr,pdf,rapid-doc,rapiddoc
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: Apache Software 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
Requires-Python: <3.14,>=3.11
Requires-Dist: rapid-doc[cpu,html,word]>=0.9.8
Description-Content-Type: text/markdown

# rapiddoc-cli

A command-line interface for [RapidAI/RapidDoc](https://github.com/RapidAI/RapidDoc) — parse PDF / image / Office documents into **Markdown / JSON / Word / HTML** with a single command.

RapidDoc is a high-performance document parsing pipeline (MinerU fork, VLM removed, ONNX-based) that runs on **CPU** — no GPU required.

## Install

```bash
# Recommended: isolated environment (doesn't pollute your system Python)
uv tool install rapiddoc-cli

# Or with pip
pip install rapiddoc-cli
```

Both expose the `rapiddoc` command. The first run downloads ONNX models (~50–100 MB) to a cache directory; subsequent runs reuse them.

## Usage

```bash
rapiddoc paper.pdf                      # → paper.out.md (default: Markdown)
rapiddoc report.pdf -f json             # → report.out.json
rapiddoc notes.docx -f word             # → notes.out.docx (Office native parsing)
rapiddoc scan.png -f html               # → scan.out.html
rapiddoc book.pdf -o book.md --lang en  # English OCR + custom output path
rapiddoc scan.png --no-formula          # skip formula recognition (faster)
```

### Options

```
rapiddoc <input> [options]

  -o, --output <path>               Output file path
  -f, --format <md|json|word|html>  Output format (default: md)
      --lang <ch|en|...>            OCR language (default: ch)
      --no-formula                  Disable formula recognition
      --no-table                    Disable table recognition
  -h, --help                        Show help
```

## Supported inputs

| Type | Formats | How it's parsed |
|---|---|---|
| PDF | `.pdf` | Model pipeline (OCR + layout + formula + table) |
| Images | `.png` `.jpg` `.jpeg` `.bmp` `.tiff` | Model pipeline |
| Office | `.docx` `.pptx` `.xlsx` | **Native parsing** (no models, very fast) |
| Legacy Office | `.doc` `.ppt` `.xls` | Converted to modern format first |

## Platform support

| Platform | Supported | Notes |
|---|---|---|
| **macOS (Apple Silicon, M-series)** | ✅ | OpenVINO is auto-skipped on ARM; runs on ONNX Runtime. No config needed. |
| **Linux x86_64** | ✅ | OpenVINO used for OCR (fastest on CPU); other stages use ONNX Runtime. |
| **Windows x86_64** | ✅ | Same engine selection as Linux x86_64. |
| **macOS (Intel x86_64)** | ❌ | Not supported. See note below. |
| **No GPU required** | — | The whole pipeline runs on CPU. There is no CUDA/MPS path. |

### Why not Intel Mac?

This is **not** a limitation of `rapiddoc-cli` itself — it's an upstream constraint:
the required dependencies `onnxruntime` and `openvino` (2025.1+) **no longer publish
wheels for macOS x86_64**. As a result `pip install rapiddoc-cli` will fail on Intel
Macs because the underlying model-inference libraries can't be installed.

Intel Mac users can run `rapiddoc-cli` inside a **Linux container/VM** (e.g. Docker
with a Linux image, or a Linux cloud VM), where x86_64 wheels are fully supported.

## How it works

`rapiddoc-cli` is a thin wrapper around the `rapid-doc` Python package. It:

1. Initializes a `RapidDoc` engine (OCR, layout, formula, table models loaded on demand)
2. Parses the input into an intermediate `middle_json` representation
3. Renders the requested output format:
   - **Markdown / JSON**: produced directly by the engine
   - **Word / HTML**: Markdown is generated first, then converted via `markdown_to_docx` / `markdown_to_html` (pypandoc / markdown-it-py)

## License

Apache-2.0 (same as upstream [rapid-doc](https://pypi.org/project/rapid-doc/)).
