Skillpedia
استخراج بيانات المواقع51k · #3488

liteparse

ما الذي تفعله

تستخرج هذه المهارة النصوص من المستندات، مثل PDF وملفات Office، ومن الصور. وتفهم تخطيط النص في الصفحة، ويمكنها إجراء التعرف الضوئي على الحروف (OCR) على المستندات الممسوحة ضوئيًا.

متى تستخدمها

  • ✓عندما تحتاج إلى استخراج النص من ملف PDF أو صورة دون إرسال الملف إلى السحابة.
  • ✓عندما تريد الحصول على الموقع الدقيق لكل كلمة في المستند، وهو مفيد للإشارة الدقيقة.
  • ✓عندما تريد تحويل المستندات الممسوحة ضوئيًا أو الصور إلى نص قابل للبحث.

رابط المهارة

https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/liteparse/SKILL.md

انسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.

طريقة الاستخدام

أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.

رسالة جاهزة للصق

استخدم هذه المهارة لمساعدتي: https://github.com/K-Dense-AI/scientific-agent-skills/blob/main/skills/liteparse/SKILL.md اقرأ ملف SKILL.md في هذا الرابط ونفّذ تعليماته لمهمتي.
تريد أن يجد الذكاء الاصطناعي مهارات مثل هذه بنفسه؟ثبّت خادم Skillpedia MCP المجاني: سطر واحد، ويبحث في 15,000+ مهارة قبل كل مهمة.ثبّته في دقيقة واحدة →

مثال على ما تطلبه من الذكاء الاصطناعي

“استخرج النص من ملف PDF للتقرير المالي، مع الحفاظ على التنسيق الأصلي.”

5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.

كيف تعمل

تزوّد المهارة بملف (PDF أو DOCX أو صورة). تقرأ المحتوى، وتحدد النص وموضعه في الصفحة، وتعيد هذه المعلومات كنص عادي، أو JSON مع الإحداثيات، أو Markdown.

المحتوى التقني (ملف SKILL.md الأصلي)

النص الأصلي من المؤلف، مباشرة من GitHub.

LiteParse — Local Document Parsing

Overview

LiteParse is an open-source document parser (Rust core, Python/Node bindings) for local, layout-aware text extraction. It produces layout text, structured JSON, or heuristic Markdown. Spatial text items may span several words; Python emit_word_boxes=True adds word boxes when needed.

Verified release: Python liteparse 2.15.0 (September 29, 2026); CLI and synthetic local PDF/image fixtures tested on Python 3.13. Node/Rust examples below are source-checked and illustrative. Images convert through bundled Rust libraries, not ImageMagick. No cloud account is needed, but missing Tesseract language data can download from GitHub and an explicitly configured HTTP OCR service receives document images.

For parser selection vs MarkItDown, PDF manipulation libraries, or LlamaParse, see references/choosing_a_parser.md.

When to Use This Skill

Use LiteParse when you need:

  • Fast local parsing of PDFs or converted Office/image files without cloud dependencies
  • Spatial text with bounding boxes for layout-aware RAG, citation grounding, or figure/table region logic
  • OCR on scanned PDFs or images (bundled Tesseract, or a user-run HTTP OCR server)
  • Page screenshots (PNG) for multimodal agents that must see charts, figures, or handwriting
  • Batch ingestion of literature folders, supplementary PDFs, or protocol libraries
  • Page subsets or password-protected PDFs

When Not to Use

Task Use instead
Markdown for LLM ingestion (EPUB, audio, YouTube, HTML) markitdown skill
Merge/split PDFs, forms, watermarks, rotation A PDF manipulation library such as pypdf
Dense tables, handwriting, production cloud pipelines LlamaParse (cloud; sign up separately)

Installation

uv pip install "liteparse==2.15.0"

This installs the Python bindings and the lit CLI. Verify:

lit --help
python -c "import liteparse; print(liteparse.__version__)"

Optional system tool (for Office inputs):

  • LibreOffice — Word, Excel, PowerPoint, OpenDocument, CSV/TSV

PNG, JPEG, TIFF, WebP, SVG and other supported images convert natively.

Install commands are in references/ocr_and_formats.md.

Node.js / TypeScript (optional): npm i @llamaindex/liteparse@2.15.0 — see references/api_reference.md.


Quick Start

Python

from 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")

CLI

# Layout-preserved text (default)
lit parse paper.pdf

# Structured JSON with bounding boxes
lit parse paper.pdf --format json -o paper.json

# Heuristic Markdown, including headings, tables and links
lit parse paper.pdf --format markdown -o paper.md

# Disable OCR on text-native PDFs (faster)
lit parse paper.pdf --no-ocr

Core Workflows

1. Parse to layout-preserved text

Best for quick full-document text or feeding chunkers that do not need coordinates.

parser = LiteParse(ocr_enabled=True, quiet=True)
result = parser.parse("document.pdf")
full_text = result.text
lit parse document.pdf -o output.txt

2. Parse to structured JSON (bounding boxes)

Use when building layout-aware RAG, highlighting source regions, or joining text with screenshots.

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
lit parse document.pdf --format json -o document.json

JSON field layout: references/output_formats.md.

3. Parse specific pages

parser = LiteParse(target_pages="1-5,10,15-20", quiet=True)
result = parser.parse("long_paper.pdf")
lit parse long_paper.pdf --target-pages "1-5,10"

4. Parse from bytes or stdin

Useful for uploads, S3 downloads, or piping remote PDFs.

with open("document.pdf", "rb") as f:
    result = parser.parse(f.read())
curl -sL https://example.com/report.pdf | lit parse -

5. Page screenshots for multimodal agents

…

الأسئلة الشائعة

هل أحتاج إلى حساب سحابي لاستخدامها؟

لا، فهي تعمل محليًا على حاسوبك، دون حاجة إلى حسابات أو إرسال بياناتك إلى الإنترنت.

هل تعمل مع المستندات الممسوحة ضوئيًا؟

نعم، فلديها تعرف ضوئي مدمج على الحروف يحوّل الصور النصية، كما في المستندات الممسوحة، إلى نص يمكنك نسخه والبحث فيه.

هل أستطيع استخراج أجزاء محددة فقط من المستند؟

نعم، يمكنك تحديد الصفحات التي تريد معالجتها، مثل «الصفحات من 1 إلى 5» أو «الصفحة 10 فقط».

التفاصيل

الوصف الأصلي من المؤلف

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 spatial text boxes, Markdown, page raster output, and local parsing with opt

repo: K-Dense-AI/scientific-agent-skills

الشعبية

نجوم GitHub
51k
الترتيب
#3488
الترخيص
MIT
آخر تحديث
15‏/10‏/2026

هل هذه المهارة مفيدة؟

0

سجّل الدخول للتصويت.

التعليقات

  • …

المزيد من المهارات من هذا المستودع

مهارات مشابهة