Metadata-Version: 2.4
Name: parse-anything
Version: 0.1.0
Summary: One interface to parse any document: pick an engine (mineru, docling, unstructured, markitdown, lite) and get clean markdown out.
Author: Yugesh
License: MIT
Project-URL: Homepage, https://github.com/yugeshsr13/parse-anything
Project-URL: Repository, https://github.com/yugeshsr13/parse-anything
Project-URL: Issues, https://github.com/yugeshsr13/parse-anything/issues
Keywords: pdf,parsing,ocr,docling,mineru,unstructured,markitdown,paddleocr,tesseract
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Operating System :: OS Independent
Classifier: Topic :: Text Processing :: Markup
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: lite
Requires-Dist: pymupdf4llm>=0.0.17; extra == "lite"
Provides-Extra: docling
Requires-Dist: docling>=2.15; extra == "docling"
Provides-Extra: unstructured
Requires-Dist: unstructured[all-docs]>=0.16; extra == "unstructured"
Provides-Extra: markitdown
Requires-Dist: markitdown[all]>=0.1.1; extra == "markitdown"
Provides-Extra: mineru
Requires-Dist: mineru[core]>=2.0; extra == "mineru"
Provides-Extra: tesseract
Requires-Dist: pytesseract>=0.3.10; extra == "tesseract"
Requires-Dist: Pillow>=10.0; extra == "tesseract"
Requires-Dist: pymupdf>=1.24; extra == "tesseract"
Provides-Extra: paddle
Requires-Dist: paddleocr>=3.0; extra == "paddle"
Requires-Dist: paddlepaddle>=3.0; extra == "paddle"
Requires-Dist: pymupdf>=1.24; extra == "paddle"
Provides-Extra: ocr
Requires-Dist: parse-anything[paddle,tesseract]; extra == "ocr"
Provides-Extra: all
Requires-Dist: parse-anything[docling,lite,markitdown,mineru,ocr,unstructured]; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest>=8.0; extra == "dev"
Dynamic: license-file

# parse-anything

One interface to parse any document. Pick an engine — **MinerU**, **Docling**, **unstructured**, **MarkItDown**, or the PyMuPDF **lite** path — pass a file path, get clean markdown/text back. OCR runs on **PaddleOCR (PP-OCRv5, default)** or **Tesseract**.

```python
from parse_anything import parse

result = parse("report.pdf", engine="miner-u")
print(result.content)          # markdown
print(result.duration_s)       # seconds
```

```bash
parse-anything report.pdf --engine miner-u -o report.md
parse-anything scan.png  --engine ocr --ocr paddle
parse-anything deck.pptx                     # auto-picks the best installed engine
```

## Install

Core has **zero dependencies**; each engine is an optional extra:

```bash
pip install -e .[all]                        # everything
pip install -e .[mineru]                     # MinerU (scanned/complex PDFs)
pip install -e .[docling]                    # Docling (structure fidelity)
pip install -e .[unstructured]               # unstructured (broadest formats)
pip install -e .[markitdown]                 # MarkItDown (office/web -> md)
pip install -e .[lite]                       # PyMuPDF fast path
pip install -e .[paddle]                     # PaddleOCR (PP-OCRv5)
pip install -e .[tesseract]                  # pytesseract (+ install the tesseract binary)
```

Windows Tesseract binary: [UB-Mannheim build](https://github.com/UB-Mannheim/tesseract/wiki) or `choco install tesseract`.

## Engines

| `--engine` | Backed by | Reach for it when |
|------------|-----------|-------------------|
| `mineru` / `miner-u` | [MinerU](https://github.com/opendatalab/MinerU) | scanned or complex PDFs — formulas, tables, multi-column; OCR built on PaddleOCR models |
| `docling` | [Docling](https://github.com/docling-project/docling) | you care about reading order, tables, office formats |
| `unstructured` | [unstructured](https://github.com/Unstructured-IO/unstructured) | odd formats: email, html, mixed batches |
| `markitdown` | [MarkItDown](https://github.com/microsoft/markitdown) | fast docx/pptx/xlsx/html → markdown (no OCR) |
| `lite` / `liteparse` | [PyMuPDF4LLM](https://github.com/pymupdf/RAG) | speed on PDFs that already have a text layer |
| `ocr` | PaddleOCR / Tesseract | images or fully scanned docs, raw text out |
| `auto` (default) | — | picks the best installed engine for the file type |

## OCR

`--ocr paddle` (default) uses **PaddleOCR PP-OCRv5** — the current open-source benchmark leader. `--ocr tesseract` is the portable fallback. `--ocr none` skips OCR (text-layer extraction only).

## Logging

Progress prints to stderr by default (auto-selected engine, OCR page-by-page, live MinerU subprocess output with a heartbeat on long runs). `-v` for debug detail, `-q` to silence it. As a library, nothing prints unless you call `logging.basicConfig(...)` yourself.

See [SKILLS.md](SKILLS.md) for the full skill contract (inputs, outputs, failure modes).

## Layout

```
src/parse_anything/
├── __init__.py        # parse(path, engine=..., ocr=...) public API
├── factory.py         # engine registry, aliases, auto-selection
├── result.py          # ParseResult
├── cli.py             # parse-anything CLI
├── engines/           # one module per backend (lazy imports)
└── ocr/               # paddle + tesseract backends, PDF rasterization
```

## Tests

```bash
pip install -e .[dev]
pytest
```
