Local File Parsing Expert: Extract PDF and Office Documents Locally with LiteParse

Preface

When reading PDFs, Word documents, or scanned files in Agent workflows, the common approaches are uploading the entire file to the model or using cloud document APIs. The former is limited by context windows and file size, while the latter often requires network connectivity, incurs usage-based fees, and is unsuitable for sensitive materials that cannot leave the local network. If you only need retrievable plain text, structured results with coordinates, or per-page screenshots for multimodal models, local parsing is more appropriate. This article introduces the “Local File Parsing Expert” on SkillHub, which integrates the CLI and Python usage of LiteParse into an Agent Skill, facilitating tasks like “Parse Document” or “Extract PDF Text” within conversations.

What is this

“Local File Parsing Expert” is a SkillHub community Skill (slug: liteparse-anything, display namespace: user_fb9c3efc), currently at version 1.0.0. The skill instructions were authored by 行空小马 (XINGKONIAO) and are built upon LiteParse, an open-source project by the LlamaIndex team (Rust core, MIT license).

It solves the problem of parsing PDF, Word, PPT, Excel, and image files on the local machine, outputting plain text, JSON with bounding boxes/coordinates, and PNG page screenshots, while supporting directory-level batch processing. The entire process does not rely on cloud parsing APIs and incurs no per-call fees.

On SkillHub, this Skill is categorized under office-efficiency, has a community rating of 98287, and approximately 1222 downloads (data derived from the SkillHub listing).

Core Features

The following capabilities are derived from the SKILL.md within the skill package and align with official LiteParse features:

  1. Multi-format Parsing: PDF, Word (.docx), Excel, PPT, Images (JPG/PNG), RTF, ODF, etc. Office formats require LibreOffice installed locally; image parsing on Windows requires ImageMagick (as noted in the skill’s optional dependencies table).
  2. Plain Text Extraction: lit parse outputs to the terminal or a file specified by -o, using --format text.
  3. Structured JSON: --format json provides text blocks with coordinates/bounding boxes, facilitating subsequent RAG or layout analysis.
  4. Page Screenshots: lit screenshot exports PNGs by page for multimodal models to visualize.
  5. Batch Processing: lit batch-parse handles directory-wide input and output, allowing specification of --format json or text.
  6. Python API: from liteparse import LiteParse; parser.parse(path) yields text, pages, blocks, etc.
  7. OCR: Images and scanned files can utilize built-in Tesseract; if Chinese character recognition is mediocre, the skill suggests optionally installing PaddleOCR (paddlepaddle, paddleocr).

Runtime Requirements: Python 3.10+.

Installation and Activation

1. Install Skill from SkillHub

Execute the following on a machine with the SkillHub CLI installed (installation command retrieved from the community source):

skillhub install liteparse-anything --namespace indiv-yemo

Upon successful installation, the skill directory is generally @indiv-yemo/liteparse-anything, containing SKILL.md and install.sh. Skill detail pages:

  • https://skillhub.cn/skills/user_fb9c3efc/liteparse-anything
  • https://api.skillhub.cn/user_fb9c3efc/liteparse-anything

To configure the Skill for your Agent product (e.g., Cursor, Codex CLI, Claude Code), follow the respective product’s method for loading SKILL.md. The skill body does not separately detail steps specific to different IDEs, so we will not expand on content not specified in the official documentation here.

2. Install LiteParse Runtime (First-time Use)

After loading the skill, ensure the liteparse Python package is installed locally. On Linux / macOS, you can execute the script within the skill package (path subject to your actual installation directory):

bash <skill_directory>/install.sh

The script checks for import liteparse and runs pip install liteparse if it is missing. You can also install manually and check the CLI:

pip install liteparse
pip show liteparse
lit --version

If pip is slow, the skill documentation suggests using the Tsinghua mirror, for example:

pip install liteparse -i https://pypi.tuna.tsinghua.edu.cn/simple

For WorkBuddy users placing the skill in the default location, the example path provided in the instructions is ~/.workbuddy/skills/liteparse-doc-converter/install.sh (functioning identically to the install.sh within the SkillHub package; subject to your local directory).

3. Optional System Dependencies

Requirement Description
Word / Excel / PPT Install LibreOffice and ensure it is in PATH
Images (Some environments) Windows users may refer to skill instructions to install ImageMagick
Chinese OCR Enhancement pip install paddlepaddle paddleocr

Typical Usage

Command Line

Extract text from a single file:

lit parse document_path.pdf

Output JSON or plain text files:

lit parse document_path.pdf --format json -o output.json
lit parse document_path.pdf --format text -o output.txt

Generate screenshots for each page:

lit screenshot document_path.pdf -o ./screenshot_directory

Batch process directories:

lit batch-parse ./input_directory ./output_directory
lit batch-parse ./input_directory ./output_directory --format json

Python

from liteparse import LiteParse

parser = LiteParse()
result = parser.parse("document.pdf")
print(result.text)
print(result.pages)
print(result.pages[0].blocks)

Word requires local LibreOffice; images will go through OCR:

result = parser.parse("report.docx")
result = parser.parse("scanned_file.jpg")

Example Workflows with Agents

Extract a PDF for writing reference:

lit parse competitor_article.pdf -o competitor_article.txt

Batch convert a material directory to text:

mkdir ./text_output
lit batch-parse ./pdf_materials ./text_output --format text

For PDFs with charts: screenshot first, then OCR the single page image:

lit screenshot data_report.pdf -o ./report_screenshots
lit parse ./report_screenshots/page_001.png

You can use the trigger words declared by the skill in conversations, such as: Parse Document, Extract PDF Text, Document to Text, lit parse, Batch Parse, Document Parsing.

Use Cases and Notes

Target Audience: Developers who need to convert local PDFs/Office files/images to text or JSON, prepare RAG corpora, or generate page images for multimodal models; teams wishing to keep data local and avoid document cloud API costs.

Limitations and Notes (From skill instructions):

  • Password-protected PDFs cannot be parsed directly; they must be decrypted first.
  • For complex tables and multi-column layouts, local results may not match cloud-based LlamaParse; this is noted in the skill documentation.
  • For very large files, pagination or batch mode is recommended to avoid memory pressure.
  • If lit is not found: pip install --upgrade liteparse; if Office parsing fails, check LibreOffice installation.

Conclusion

“Local File Parsing Expert” consolidates the installation, CLI, and Python calls of LiteParse into a SKILL.md that Agents can follow. It is suitable for driving local document parsing via natural language or keywords after installation from SkillHub. For open-source engine and license information, see run-llama/liteparse; Official Skill Entry: https://api.skillhub.cn/user_fb9c3efc/liteparse-anything .

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye