360 Secure SkillHub
360 安全技能中心

clawd LiteParse

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

ricanwarfare
ricanwarfare
热度 43.55
最近更新 2026-04-08 08:26:48
分类:效率依赖:代码执行 / 读写文件应用场景:文件转换 / 数据处理 / 自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add clawd-liteparse
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