360 Secure SkillHub
360 安全技能中心

LiteParse Document Parser

LiteParse 提供本地命令行文档解析能力,可将 PDF、Word、PowerPoint、表格和图片转换为纯文本或带边界框的 JSON,支持按页范围解析、批量目录处理和页面截图生成;处理 Office 文档需 LibreOffice,处理图片需 ImageMagick,运行时不依赖云端或 LLM。

分类:效率
ricanwarfare
ricanwarfare
热度 34.02
最近更新 2026-05-11 17:40:25

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add ricanwarfare/liteparse-docs
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
liteparse
version
1.0.0
description
Use when parsing PDFs, DOCX, PPTX, XLSX, or images locally. Supports text extraction, JSON output with bounding boxes, batch processing, and page screenshots. No cloud dependencies.
license
Apache-2.0

LiteParse

Parse unstructured documents (PDF, DOCX, PPTX, XLSX, images, and more) locally with LiteParse: fast, lightweight, no cloud dependencies or LLM required.

Installation

Already installed via Homebrew:

brew install llamaindex-liteparse

Verify:

lit --version

Supported Formats

Category Formats
PDF .pdf
Word .doc, .docx, .docm, .odt, .rtf
PowerPoint .ppt, .pptx, .pptm, .odp
Spreadsheets .xls, .xlsx, .xlsm, .ods, .csv, .tsv
Images .jpg, .jpeg, .png, .gif, .bmp, .tiff, .webp, .svg

Dependencies:

  • Office documents → LibreOffice (brew install --cask libreoffice)
  • Images → ImageMagick (brew install imagemagick)

Usage

Parse a Single File

# Basic text extraction
lit parse document.pdf

# JSON output with bounding boxes
lit parse document.pdf --format json -o output.json

# Specific page range
lit parse document.pdf --target-pages "1-5,10,15-20"

# Disable OCR (faster, text-only PDFs)
lit parse document.pdf --no-ocr

# Higher DPI for better quality
lit parse document.pdf --dpi 300

Batch Parse a Directory

lit batch-parse ./input-directory ./output-directory

# Only PDFs, recursively
lit batch-parse ./input ./output --extension .pdf --recursive

Generate Page Screenshots

# All pages
lit screenshot document.pdf -o ./screenshots

# Specific pages
lit screenshot document.pdf --target-pages "1,3,5" -o ./screenshots

# High-DPI PNG
lit screenshot document.pdf --dpi 300 --format png -o ./screenshots

Key Options

Option Description
--format json Structured JSON with bounding boxes
--format text Plain text (default)
--target-pages "1-5,10" Parse specific pages
--dpi 300 Higher rendering quality
--no-ocr Disable OCR (faster for text PDFs)
--ocr-language fra Set OCR language
-o output.json Save to file

Config File

For repeated use, create liteparse.config.json:

{
  "ocrLanguage": "en",
  "ocrEnabled": true,
  "maxPages": 1000,
  "dpi": 150,
  "outputFormat": "json",
  "preciseBoundingBox": true
}

Use with:

lit parse document.pdf --config liteparse.config.json

When to Use

  • PDF text extraction — fast local parsing
  • Document conversion — Office docs to text/JSON
  • Screenshot generation — for LLM visual analysis
  • Batch processing — multiple files at once
  • Offline/air-gapped — no cloud required