Skip to main content

LiteDoc in your terminal: deterministic PDF → Markdown with an optional bring-your-own-AI repair pass. Same engine as litedoc.xyz.

Project description

litedoc-cli

The litedoc.xyz extraction engine in your terminal: deterministic PDF → Markdown that never hallucinates, engineered for server pipelines, RAG ingestion, and local workflow automation. Includes an optional, triage-first AI repair pass you can point at your own model.

pip install litedoc-cli
playwright install chromium        # one-time engine download

# Basic & Batch Conversion
litedoc convert paper.pdf                                # markdown to stdout
litedoc convert scans/*.pdf -o out/ --ocr                # batch + OCR fallback
litedoc convert paper.pdf -o out/ --images out/images    # extracted figures as JPEGs

# Precision & Quality Controls (New in v3.2.0!)
litedoc convert textbook.pdf --pages "1-5,12-15" -o out/ # slice exact page ranges
litedoc convert diagrams.pdf --img-res 600 -o out/       # set custom figure DPI (75,150,300,600)
litedoc convert batch/*.pdf --auto-resolve clean         # set OCR conflict handling strategy
litedoc convert massive.pdf -o out/ --verbose            # stream live diagnostic stage events

# Live Automation Daemons (Obsidian / RAG Dropzones)
litedoc convert ~/obsidian/inbox -o ~/obsidian/notes --watch --recursive

# AI Repair (Bring Your Own Model)
litedoc convert scan.pdf --ai-url http://localhost:11434 --ai-model llama3.1:8b

Features & Philosophy

  • Identical output to the web app — it drives the same single-file engine headlessly.
  • Deterministic by default — no AI flag, no network: nothing leaves your machine.
  • Precision Extraction & Page Slicing--pages lets you extract targeted chapters or sections without paying compute or token overhead for entire volumes.
  • Live Folder Watcher & Daemon Mode — drop --watch (-w) and --recursive (-r) onto an ingestion directory to run an automated, zero-dependency background RAG pipeline that instantly turns newly dropped PDFs into structured Markdown.
  • Automated QA & Auto-Resolve — configure batch conflict handling (--auto-resolve {render,gibberish,clean,skip}) so batch scripts run unattended without manual verification breaks.
  • Headless Performance Benchmarking — test processing speeds on your hardware anytime:
    litedoc benchmark --iterations 3 --json
    
    Reports worker spin-up latency, burst PPT (Pages Per Toast), and sustained PPM (Pages Per Minute).
  • Persistent Global Configuration — customize your default CLI conversion parameters so you don't have to repeat flags across invocations:
    litedoc config --set img_res=600 auto_resolve=render verbose=true
    litedoc config # inspect currently stored defaults (~/.config/litedoc/config.json)
    
  • Bring your own AI--ai-url speaks Ollama or OpenAI-compatible protocols; only sections that are provably damaged (broken sentences, ragged tables, OCR artifacts) are ever sent. --ai uses the hosted LiteDoc service instead (token from LITEDOC_TOKEN).
  • Structure, not just prose--json returns per-page layout (lines with coordinates, font sizes, reading-order blocks, OCR provenance; tables as row arrays; figures with page + bounding box), and --images DIR writes detected figures — cropped to include their axis labels and annotations — as JPEG files linked from the markdown.

License: AGPL-3.0. Part of the LiteDoc project.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

litedoc_cli-3.2.0.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

litedoc_cli-3.2.0-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file litedoc_cli-3.2.0.tar.gz.

File metadata

  • Download URL: litedoc_cli-3.2.0.tar.gz
  • Upload date:
  • Size: 1.1 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for litedoc_cli-3.2.0.tar.gz
Algorithm Hash digest
SHA256 f2367770eade4b2fe26983114f9e14cbf9dac89019525a8593643d0cd3f92eb6
MD5 3c6d2fa136db3ff95aeb7064207cd183
BLAKE2b-256 f0acc02accf701dd598fea7aa558bc72fe2eff8358f763d4145b8d8990d35e5e

See more details on using hashes here.

Provenance

The following attestation bundles were made for litedoc_cli-3.2.0.tar.gz:

Publisher: publish.yml on 0xovo/LiteDoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file litedoc_cli-3.2.0-py3-none-any.whl.

File metadata

  • Download URL: litedoc_cli-3.2.0-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.14

File hashes

Hashes for litedoc_cli-3.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 def61fd255183837270d79bd59bf831433e2e48e2beafad7c9de164427c899c9
MD5 c12f17c0d13d07971be37ccd3d921489
BLAKE2b-256 37c4d6d4d4bd57dfb7a557c7435743e4f86eaf06376a8878f7b499521ba71f20

See more details on using hashes here.

Provenance

The following attestation bundles were made for litedoc_cli-3.2.0-py3-none-any.whl:

Publisher: publish.yml on 0xovo/LiteDoc

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page