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

Metadata

Release files for parsy-doc 3.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for parsy-doc 3.0.2
File Size Uploaded Provenance Actions
parsy_doc-3.0.2.tar.gz 78.8 kB Without provenance Details for parsy_doc-3.0.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for parsy-doc 3.0.2
File Interpreter ABI Platform Actions
parsy_doc-3.0.2-py3-none-any.whl Python 3 none any Details for parsy_doc-3.0.2-py3-none-any.whl

Total release size: 155.6 kB

Release files / parsy_doc-3.0.2.tar.gz

Download URL parsy_doc-3.0.2.tar.gz
Size 78.8 kB
Tags Source
SHA-256 checksum
How to use checksums
f427cf51041d8bd6bfd3456a94982ec107102910735483db2af7c565dc163a0e
BLAKE2b-256 checksum
How to use checksums
6bf01154ae124da39bbebcd844d7f12a0ddf773cc1aaae741ad383ba949e3a50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Release files / parsy_doc-3.0.2-py3-none-any.whl

Download URL parsy_doc-3.0.2-py3-none-any.whl
Size 76.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ab46f75bcc0c2edd1957f827eb86ab7d42d78a614ca627ff9a062336f346894c
BLAKE2b-256 checksum
How to use checksums
35f49ef210764b5a1770cf55043503092c5d2c2a8248e3adc01e90d759ba7e0f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.9

Security for parsy-doc 3.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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