Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Local document and PDF parsing that returns spatial text with bounding boxes. Use for extracting text from PDFs, DOCX, Office files, and images; running OCR on scans; producing layout-preserved JSON for RAG; batch-ingesting folders of papers; or rendering pages to PNG for multimodal agents. Distinguishing capabilities are per-token bounding boxes, page raster output, and fully local processing with no cloud API.
.claude/skills/k-dense-ai-liteparse/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 52% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 72% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 270% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 31% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 23% | 0% |
LiteParse is a fast, open-source document parser (Rust core, Python/Node bindings) focused on local, layout-aware text extraction with bounding boxes. It does not produce Markdown and does not call cloud LLMs. Outputs are plain text (layout-preserved) or structured JSON with per-page text_items (position, font metadata, optional confidence).
Version note: Examples target liteparse 2.0.0 (PyPI, May 2026). The upstream V1 branch is legacy; this skill documents V2 / main only.
For parser selection vs MarkItDown, the pdf skill, or LlamaParse, see references/choosing_a_parser.md.
Use LiteParse when you need:
| Task | Use instead | |------|-------------| | Markdown for LLM ingestion (EPUB, audio, YouTube, HTML) | markitdown skill | | Merge/split PDFs, forms, watermarks, rotation | pdf skill | | Dense tables, handwriting, production cloud pipelines | LlamaParse (cloud; sign up separately) |
bashuv pip install "liteparse==2.0.0"
This installs the Python bindings and the lit CLI. Verify:
bashlit --help python -c "import liteparse; print(liteparse.__version__)"
Optional system tools (for non-PDF inputs):
Install commands are in references/ocr_and_formats.md.
Node.js / TypeScript (optional): npm i @llamaindex/liteparse — see references/api_reference.md.
pythonfrom liteparse import LiteParse parser = LiteParse(quiet=True) result = parser.parse("paper.pdf") print(result.text) for page in result.pages: print(f"Page {page.page_num}: {len(page.text_items)} items")
bash# Layout-preserved text (default) lit parse paper.pdf # Structured JSON with bounding boxes lit parse paper.pdf --format json -o paper.json # Disable OCR on text-native PDFs (faster) lit parse paper.pdf --no-ocr
Best for quick full-document text or feeding chunkers that do not need coordinates.
pythonparser = LiteParse(ocr_enabled=True, quiet=True) result = parser.parse("document.pdf") full_text = result.text
bashlit parse document.pdf -o output.txt
Use when building layout-aware RAG, highlighting source regions, or joining text with screenshots.
pythonimport json from liteparse import LiteParse parser = LiteParse(output_format="json", quiet=True) result = parser.parse("document.pdf") # Programmatic access for page in result.pages: for item in page.text_items: bbox = (item.x, item.y, item.width, item.height) # item.text, item.confidence, item.font_name, item.font_size
bashlit parse document.pdf --format json -o document.json
JSON field layout: references/output_formats.md.
pythonparser = LiteParse(target_pages="1-5,10,15-20", quiet=True) result = parser.parse("long_paper.pdf")
bashlit parse long_paper.pdf --target-pages "1-5,10"
Useful for uploads, S3 downloads, or piping remote PDFs.
pythonwith open("document.pdf", "rb") as f: result = parser.parse(f.read())
bashcurl -sL https://example.com/report.pdf | lit parse -
Screenshots capture visual content that text extraction alone misses (figures, complex tables, handwriting).
pythonfrom pathlib import Path parser = LiteParse(dpi=150, quiet=True) shots = parser.screenshot("document.pdf", page_numbers=[1, 2, 3]) out = Path("screenshots") out.mkdir(exist_ok=True) for s in shots: (out / f"page_{s.page_num}.png").write_bytes(s.image_bytes)
bashlit screenshot document.pdf --target-pages "1,3,5" -o ./screenshots lit screenshot document.pdf --dpi 300 -o ./screenshots
Combine JSON parse + screenshots when an agent needs both coordinates and pixels for the same pages.
For large corpora, prefer the CLI (parallel OCR workers) or the bundled script.
bashlit batch-parse ./papers ./parsed --format json --recursive lit batch-parse ./papers ./parsed --extension .pdf --no-ocr
bashpython scripts/batch_parse_dir.py ./papers ./parsed --format json --recursive
See scripts/batch_parse_dir.py for a Python batch wrapper without network calls.
OCR is on by default. Tesseract is bundled; no extra install for basic English OCR.
pythonparser = LiteParse( ocr_enabled=True, ocr_language="eng", # Tesseract codes: fra, deu, etc. num_workers=4, # parallel OCR (default: CPU cores - 1) dpi=150, # higher DPI → better OCR, slower )
bashlit parse scan.pdf --ocr-language fra lit parse scan.pdf --no-ocr lit parse scan.pdf --ocr-server-url http://localhost:8080/ocr
Offline / air-gapped: set TESSDATA_PREFIX to a directory of .traineddata files, or pass --tessdata-path. Details: references/ocr_and_formats.md.
pythonparser = LiteParse(password="secret", quiet=True) result = parser.parse("protected.pdf")
bashlit parse protected.pdf --password secret
Merge adjacent items and return combined bounding boxes for a phrase (e.g. section titles).
pythonfrom liteparse import search_items page = result.get_page(1) matches = search_items(page.text_items, "Materials and Methods", case_sensitive=False)
| Category | Extensions (examples) | Requirement | |----------|----------------------|-------------| | PDF | .pdf | Native | | Office | .docx, .xlsx, .pptx, .doc, .odt, … | LibreOffice | | Images | .png, .jpg, .tiff, .webp, .svg, … | ImageMagick |
Files are converted to PDF internally, then parsed. If conversion tools are missing, parsing fails with an actionable error — install the dependency and retry.
--no-ocr on born-digital PDFs — largest speeduptarget_pages — parse only methods/supplement sectionsnum_workers — scale OCR across CPU coresmax_pages — cap very large files (default 1000)lit batch-parse — directory-scale jobs with --recursive and --extensiondpi (e.g. 100) when OCR quality is already sufficient| File | Read when | |------|-----------| | references/choosing_a_parser.md | Unsure whether to use LiteParse, MarkItDown, pdf, or LlamaParse | | references/api_reference.md | Python/TypeScript API, types, search_items | | references/cli_reference.md | Full lit command flags | | references/output_formats.md | JSON schema, bboxes, confidence scores | | references/ocr_and_formats.md | Tesseract, HTTP OCR, LibreOffice, ImageMagick |
| Issue | Fix | |-------|-----| | Office file fails | Install LibreOffice; ensure soffice is on PATH (Windows: add LibreOffice program dir) | | Image fails | Install ImageMagick; verify convert or magick works | | OCR poor quality | Increase --dpi; try --ocr-language; or HTTP OCR server | | OCR slow | --no-ocr if not needed; reduce pages; increase num_workers | | Air-gapped OCR | export TESSDATA_PREFIX=/path/to/tessdata or --tessdata-path | | ParseError on bytes | Ensure input is valid PDF bytes (Office bytes need a file path + conversion) |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 39,228 | 5,117 | -87% | 1 | 1 | 0% | 2,295 | 3,488 | +52% | 0 | 0 | — |
case-02 | fail→pass | 71,889 | 4,090 | -94% | 1 | 1 | 0% | 1,853 | 3,184 | +72% | 0 | 0 | — |
case-03 | fail→pass | 12,003 | 2,693 | -78% | 1 | 1 | 0% | 783 | 2,901 | +270% | 0 | 0 | — |
case-04 | pass→pass | 19,112 | 5,070 | -73% | 1 | 1 | 0% | 3,668 | 3,406 | -7% | 0 | 0 | — |
case-05 | fail→pass | 15,181 | 8,221 | -46% | 1 | 1 | 0% | 3,168 | 4,161 | +31% | 0 | 0 | — |
case-06 | fail→pass | 16,615 | 5,885 | -65% | 1 | 1 | 0% | 2,791 | 3,428 | +23% | 0 | 0 | — |
case-07 | fail→pass | 18,046 | 7,544 | -58% | 1 | 1 | 0% | 3,456 | 4,001 | +16% | 0 | 0 | — |
case-08 | fail→pass | 5,264 | 63,504 | +1106% | 1 | 1 | 0% | 1,006 | 2,821 | +180% | 0 | 0 | — |
case-09 | fail→pass | 9,317 | 5,309 | -43% | 1 | 1 | 0% | 2,004 | 3,416 | +70% | 0 | 0 | — |
case-10 | fail→pass | 4,340 | 63,847 | +1371% | 1 | 1 | 0% | 639 | 2,865 | +348% | 0 | 0 | — |
case-11 | fail→pass | 16,181 | 3,347 | -79% | 1 | 1 | 0% | 3,006 | 3,064 | +2% | 0 | 0 | — |
case-12 | pass→pass | 10,304 | 2,413 | -77% | 1 | 1 | 0% | 1,802 | 2,834 | +57% | 0 | 0 | — |
case-13 | fail→pass | 9,980 | 2,320 | -77% | 1 | 1 | 0% | 1,805 | 2,845 | +58% | 0 | 0 | — |
case-14 | pass→pass | 10,556 | 4,563 | -57% | 1 | 1 | 0% | 1,923 | 3,313 | +72% | 0 | 0 | — |
case-15 | pass→pass | 7,096 | 3,553 | -50% | 1 | 1 | 0% | 1,218 | 3,036 | +149% | 0 | 0 | — |
case-16 | pass→pass | 6,097 | 63,533 | +942% | 1 | 1 | 0% | 962 | 2,759 | +187% | 0 | 0 | — |
case-17 | pass→pass | 9,984 | 4,703 | -53% | 1 | 1 | 0% | 1,917 | 3,375 | +76% | 0 | 0 | — |
case-18 | pass→pass | 7,626 | 2,480 | -67% | 1 | 1 | 0% | 1,422 | 2,925 | +106% | 0 | 0 | — |
case-19 | fail→pass | 9,147 | 4,043 | -56% | 1 | 1 | 0% | 1,582 | 3,131 | +98% | 0 | 0 | — |
case-20 | fail→pass | 22,659 | 51,877 | +129% | 1 | 1 | 0% | 4,256 | 2,839 | -33% | 0 | 0 | — |
case-21 | fail→pass | 9,937 | 2,323 | -77% | 1 | 1 | 0% | 2,067 | 2,868 | +39% | 0 | 0 | — |
case-22 | pass→pass | 6,360 | 2,076 | -67% | 1 | 1 | 0% | 1,262 | 2,791 | +121% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 21 counted toward the lift figure. The other 1 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of +64 percentage points is the difference between those two pass rates over the 21 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.