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 —
--pageslets 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-urlspeaks Ollama or OpenAI-compatible protocols; only sections that are provably damaged (broken sentences, ragged tables, OCR artifacts) are ever sent.--aiuses the hosted LiteDoc service instead (token fromLITEDOC_TOKEN). - Structure, not just prose —
--jsonreturns per-page layout (lines with coordinates, font sizes, reading-order blocks, OCR provenance; tables as row arrays; figures with page + bounding box), and--images DIRwrites 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2367770eade4b2fe26983114f9e14cbf9dac89019525a8593643d0cd3f92eb6
|
|
| MD5 |
3c6d2fa136db3ff95aeb7064207cd183
|
|
| BLAKE2b-256 |
f0acc02accf701dd598fea7aa558bc72fe2eff8358f763d4145b8d8990d35e5e
|
Provenance
The following attestation bundles were made for litedoc_cli-3.2.0.tar.gz:
Publisher:
publish.yml on 0xovo/LiteDoc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
litedoc_cli-3.2.0.tar.gz -
Subject digest:
f2367770eade4b2fe26983114f9e14cbf9dac89019525a8593643d0cd3f92eb6 - Sigstore transparency entry: 2255374709
- Sigstore integration time:
-
Permalink:
0xovo/LiteDoc@1d545e56c7a0b25dae0e690194f9ee9bb7fcb219 -
Branch / Tag:
refs/tags/v3.2.0 - Owner: https://github.com/0xovo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1d545e56c7a0b25dae0e690194f9ee9bb7fcb219 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
def61fd255183837270d79bd59bf831433e2e48e2beafad7c9de164427c899c9
|
|
| MD5 |
c12f17c0d13d07971be37ccd3d921489
|
|
| BLAKE2b-256 |
37c4d6d4d4bd57dfb7a557c7435743e4f86eaf06376a8878f7b499521ba71f20
|
Provenance
The following attestation bundles were made for litedoc_cli-3.2.0-py3-none-any.whl:
Publisher:
publish.yml on 0xovo/LiteDoc
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
litedoc_cli-3.2.0-py3-none-any.whl -
Subject digest:
def61fd255183837270d79bd59bf831433e2e48e2beafad7c9de164427c899c9 - Sigstore transparency entry: 2255374720
- Sigstore integration time:
-
Permalink:
0xovo/LiteDoc@1d545e56c7a0b25dae0e690194f9ee9bb7fcb219 -
Branch / Tag:
refs/tags/v3.2.0 - Owner: https://github.com/0xovo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@1d545e56c7a0b25dae0e690194f9ee9bb7fcb219 -
Trigger Event:
release
-
Statement type: