Skip to main content

Parsy — Document Intelligence Engine

PyPI Python License: MIT

Parsy is a high-performance, privacy-preserving document intelligence engine.
Parse PDFs, DOCX, HTML, TXT, CSV, JSON, and XML into clean Markdown, JSON, HTML, or CSV — fully locally with no data leaving your machine.


✨ Features

  • Blazing fast — Zero-copy PyMuPDF extraction, parallel page processing
  • 🔒 Private — Runs 100% locally, no internet required after install
  • 📄 Multi-format — PDF, DOCX, TXT, HTML, CSV, JSON, XML, XLSX
  • 🧠 ML-powered (optional) — Layout regions, semantic heading clusters, table structure
  • 🌊 SSE streaming — Real-time progressive output for large documents
  • 🖥️ CLI + Python API + REST API — Use however you want

📦 Installation

pip install parsy-doc

With optional ML structural analysis:

pip install parsy-doc[ml]

With OCR support (requires Tesseract installed on your system):

pip install parsy-doc[ocr]

Full installation:

pip install parsy-doc[all]

🚀 Quick Start

Python API

import parsy

# Parse a PDF to Markdown
result = parsy.parse("contract.pdf")
print(result.markdown)

# Parse to JSON
result = parsy.parse("invoice.pdf", format="json")
print(result.json)

# Access tables directly
for table in result.tables:
    print(table)

# View parsing metrics
print(result.metrics)
# → {'wordCount': 4231, 'pageCount': 18, 'charCount': 24100, ...}

Async API (FastAPI, asyncio)

import parsy
import asyncio

async def main():
    result = await parsy.parse_async("report.pdf", format="markdown")
    print(result.markdown)

asyncio.run(main())

💻 Command-Line Interface

After installing, a parsy command is available globally:

# Parse a PDF and print to terminal
parsy parse report.pdf

# Save to file in JSON format
parsy parse invoice.pdf --format json --output invoice.json

# Parse all PDFs in a folder (batch mode)
parsy parse docs/*.pdf --format markdown --output ./results/

# Enable ML analysis
parsy parse research_paper.pdf --ml

# Launch the local REST API server + web UI
parsy serve

# Custom host and port
parsy serve --host 0.0.0.0 --port 8080

# Check version
parsy --version

🌐 REST API Server

Start the streaming REST API server:

parsy serve
# → http://localhost:8000

Then use the web UI at http://localhost:8000 or POST to the API:

curl -X POST http://localhost:8000/parse \
  -F "file=@report.pdf" \
  -F "format=markdown"

The API uses Server-Sent Events (SSE) for real-time streaming progress.


⚙️ Options

Option Values Default Description
format markdown, json, html, csv, plaintext markdown Output format
tables bool True Extract tables
clean bool True Whitespace cleanup
use_ml bool False Enable ML structural analysis

🔬 Supported File Types

Format Extension Notes
PDF (digital) .pdf Full text + table extraction
PDF (scanned) .pdf OCR via Tesseract (pip install parsy-doc[ocr])
Word .docx Headings, paragraphs, tables
HTML .html, .htm Semantic extraction
Plain text .txt, .rtf Encoding auto-detected
Markdown .md Passthrough + re-format
Spreadsheet .xlsx, .csv Table-centric output
Data .json, .xml Structured extraction

🏛️ Architecture

parsy parse() / parse_async()
        │
        ▼
  DocumentRouter          ← heuristic inspection
        │
  ┌─────┴──────────┐
  │                │
Fast Parser     Vision OCR     ← PyMuPDF / Tesseract
  │
  ▼
Normalizer                     ← Markdown, JSON, HTML, CSV
  │
  ▼
ParseResult

📄 License

MIT — see LICENSE

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

parsy_doc-3.0.1.tar.gz (78.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

parsy_doc-3.0.1-py3-none-any.whl (76.6 kB view details)

Uploaded Python 3

File details

Details for the file parsy_doc-3.0.1.tar.gz.

File metadata

  • Download URL: parsy_doc-3.0.1.tar.gz
  • Upload date:
  • Size: 78.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.9

File hashes

Hashes for parsy_doc-3.0.1.tar.gz
Algorithm Hash digest
SHA256 bb181e66d5f5778a018768ab699af766fe283e7a7e320bb31a4a0a44f0bae716
MD5 fa565e73454af3463c596452f2bb56f8
BLAKE2b-256 0874eae4ee22ffe8d40e3b37a35fb080235d35243b053f2c0d750fc85fe1d14e

See more details on using hashes here.

File details

Details for the file parsy_doc-3.0.1-py3-none-any.whl.

File metadata

  • Download URL: parsy_doc-3.0.1-py3-none-any.whl
  • Upload date:
  • Size: 76.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.9

File hashes

Hashes for parsy_doc-3.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 78cda6988ee3284782c57697c78cc78b7f289dae7a5a1b453e9e50bfb9169023
MD5 15e9a84b52afc89f9f4dac8f98610995
BLAKE2b-256 5f156724c4aaea87b786e73a7a9171017b0e8678ea58d1f7a9ea0881c0cd1c83

See more details on using hashes here.

Release history Release notifications | RSS feed

3.0.2

2 files

This release

3.0.1 This release

2 files

3.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page