Back to Discover

ailang-parse

connector

sunholo-data

Deterministic DOCX/PPTX/XLSX/PDF parser: track changes, comments, headers, footers, merged cells.

View on GitHub
0 starsSynced Aug 14, 2026

Install to Claude Code

/plugin marketplace add sunholo-data/ailang-parse

README

AILANG Parse

AILANG Registry PyPI npm Go MCP Registry CI

Universal document parsing in AILANG. Extracts structured content from DOCX, PPTX, XLSX, PDF, and image files into JSON and markdown.

Office formats (DOCX, PPTX, XLSX) use deterministic XML parsing — no AI, no cloud, instant results. PDFs default to the deterministic pdftotext backend (poppler) — also no AI, no cloud — with docling and liteparse as local alternatives and pluggable AI (Gemini, Claude, local Ollama) for scanned/image-only pages via --pdf-backend ai. Images delegate to whatever AI model you plug in. AILANG Parse is AI-agnostic: swap --pdf-backend/--ai to change the backend, zero code changes.

Install

Requires AILANG CLI.

# Clone and symlink
git clone https://github.com/sunholo-data/ailang-parse.git
ln -s "$(pwd)/ailang-parse/bin/docparse" /usr/local/bin/docparse

SDKs

Use AILANG Parse from your language of choice:

pip install ailang-parse          # Python
npm install @ailang/parse         # JavaScript/TypeScript
go get github.com/sunholo-data/ailang-parse-go  # Go

Quick Start

# Office documents (deterministic, no AI needed)
docparse report.docx
docparse slides.pptx
docparse spreadsheet.xlsx

# PDF (deterministic pdftotext by default — no AI); images (AI auto-enabled)
docparse document.pdf
docparse photo.png

# Options
docparse report.docx describe        # AI image descriptions
docparse report.docx summarize       # AI document summary
docparse contract.pdf                # PDF: deterministic pdftotext (default)
docparse scan.pdf --pdf-backend ai --ai gemini-2.5-flash  # Scanned PDF needs AI

# Format conversion
docparse report.docx --convert output.html
docparse data.csv --convert report.docx
docparse notes.md --convert slides.pptx

# AI document generation
ailang run --entry main --caps IO,FS,Env,AI --ai gemini-2.5-flash \
  docparse/main.ail --generate report.docx --prompt "Q1 sales report with tables"

Output

Every run produces:

  • docparse/data/output.json — Structured JSON with typed blocks
  • docparse/data/output.md — LLM-ready markdown

What AILANG Parse Extracts

FeatureDOCXPPTXXLSXBest Competitor
Tables with merged cellsYesYesYesRaw OOXML only
Track changes (redlining)YesPandoc (3/3)
Comments (interleaved)YesRaw OOXML (2/2)
Headers/footersYesKreuzberg (2/3)
Text boxes / VML shapesYesYesRaw OOXML (1/2)
Equations (§22.1)YesNone
Field codes (§17.16)YesKreuzberg, OOXML
Speaker notesYesNone
Multi-sheet extractionYesKreuzberg

OfficeDocBench (69 files, 11 formats, 7 metrics): AILANG Parse 93.9% composite with 100% coverage vs nearest competitor 68.0% coverage-adjusted. 8 parsers compared including Raw OOXML, Pandoc, Kreuzberg, MarkItDown, Unstructured, Docling. Scores include aspirational ECMA-376 spec targets that intentionally lower our score.

Supported Formats

Parsing (16 formats): DOCX, PPTX, XLSX, ODT, ODP, ODS, HTML, Markdown, CSV, EPUB, EML, MBOX, TEX, RTF, PDF, images (JPG/PNG)

Generation (9 formats): DOCX, PPTX, XLSX, ODT, ODP, ODS, HTML, Markdown, QMD (Quarto)

Writing documents in Markdown

Markdown is the input an LLM can write, so it is the practical way to generate a document: write markdown, convert to any of the nine output formats.

docparse report.md --convert report.docx

What survives the trip: YAML front matter (title/author/date → document properties), bold/italic/code/strike as real character formatting, links as real hyperlinks, images (local paths are read and embedded), fenced code blocks, blockquotes, nested lists, thematic breaks, and tables with alignment and column spans.

Headers, footers, comments and tracked changes have no Markdown syntax; those are preserved when converting from a document that already contains them.

Architecture

docparse/
├── types/document.ail           # Block ADT (9 variants)
├── services/
│   ├── format_router.ail        # Format detection (36 inline tests)
│   ├── zip_extract.ail          # ZIP layer (9 inline tests)
│   ├── docx_parser.ail          # DOCX XML → Blocks (6 inline tests)
│   ├── pptx_parser.ail          # PPTX slides → Blocks
│   ├── xlsx_parser.ail          # XLSX worksheets → Blocks
│   ├── direct_ai_parser.ail     # PDF/image → Blocks (AI)
│   ├── layout_ai.ail            # AI self-healing (optional)
│   ├── output_formatter.ail     # JSON + markdown output
│   └── docparse_browser.ail     # WASM browser adapter
└── main.ail                     # CLI entry point

28+ contracts, 50+ inline tests.

AI Configuration

AILANG Parse uses AILANG's AI effect — any model AILANG supports works:

docparse scan.pdf --ai gemini-2.5-flash          # Google (default; fast)
docparse scan.pdf --ai gemini-3-flash-preview    # Google (slower; thinking model)
docparse scan.pdf --ai granite-docling           # Local Ollama (free)
docparse scan.pdf --ai claude-haiku-4-5          # Anthropic

AI usage is bounded by capability budgets (AI @limit=30), so costs are predictable.

Dev Commands

docparse --check       # Type-check all modules
docparse --test        # Run inline tests
docparse --prove       # Static Z3 contract verification

Benchmarks

uv run benchmarks/run_benchmarks.py --suite office     # Structural (no API, instant)
uv run benchmarks/run_benchmarks.py --suite pdf         # PDF extraction (needs AI)
uv run benchmarks/run_benchmarks.py --competitors       # Compare to Docling etc.

See benchmarks/ for details.

License

Apache 2.0

Rendered live from sunholo-data/ailang-parse's GitHub README — not stored, always reflects the source repo.

3 Install Methods

NameDescriptionCategorySource
npm packageInstall via npm (stdio transport)mcp-server@ailang/parse
pypi packageInstall via pypi (stdio transport)mcp-serverailang-parse
streamable-http remoteHosted streamable-http endpointmcp-serverhttps://docparse.ailang.sunholo.com/mcp/

0 Comments

Login required
Log in to post a comment or update on this repo.

No comments yet — be the first to share an update.