Command line reference

Every subcommand and flag, generated from the parser. For what the flags are for, see using the command line.

Command line entry point.

usage: tetrak-ocr [-h] {backends,ocr,batch,triage,evaluate} ...

Positional Arguments

command

Possible choices: backends, ocr, batch, triage, evaluate

Sub-commands

backends

list backends and whether they are installed

tetrak-ocr backends [-h]

ocr

OCR a single file

tetrak-ocr ocr [-h]
               [--backend {tesseract,tesseract-auto,claude,claude-haiku,easyocr,easyocr-hy,paddle,paddle-vl,marker,vision,auto-local}]
               [--output OUTPUT] [--contrast FACTOR] [--psm MODE] [--auto]
               [--with-paddle-vl] [--format FORMAT] [--pdf [PATH]]
               [--pdf-full-size] [--pdf-font PATH] [--orient SCRIPT]
               path

Positional Arguments

path

image or PDF to transcribe

Named Arguments

--backend

Possible choices: tesseract, tesseract-auto, claude, claude-haiku, easyocr, easyocr-hy, paddle, paddle-vl, marker, vision, auto-local

Default: 'tesseract'

--output

write to this file instead of stdout

--contrast

Contrast factor for Tesseract (default: 2.0); try 3.0 for faded originals.

--psm

Tesseract page segmentation mode (default: 3). 3=auto, 6=block, 11=sparse.

--auto

Auto-configure Tesseract contrast and PSM per image.

Default: False

--with-paddle-vl

Add PaddleOCR-VL to the auto-local pool. It measures as the strongest local backend and wins where the rest of the pool is weakest, but costs minutes per page rather than seconds, so it is opt-in. Needs the paddle-vl extra; ignored by every other backend, which you name directly instead.

Default: False

--format, -f

output format to write, repeatable or comma-separated. Choose from: markdown, text, pdf. Defaults to markdown.

--pdf

shorthand for adding ‘pdf’ to –format: the scan with the transcript embedded as an invisible text layer, which is what makes it indexable in Preservica, CONTENTdm, Omeka and AtoM

Default: False

--pdf-full-size

embed the source image untouched instead of a downsampled access copy. Implies –pdf. Larger files; use when the PDF is the deliverable rather than a derivative

Default: False

--pdf-font

TrueType font for the text layer. Only needed for scripts the built-in font cannot encode; without one, such a transcript is refused rather than written as black boxes

--orient

Possible choices: latin, armenian

turn the page upright before reading it, judging which way is up by the named script (latin, armenian). Turned only when the reading is clear; the scan itself is never changed. Single-page files only; ‘armenian’ needs the orientation extra

batch

process everything in workspace/scans/

tetrak-ocr batch [-h]
                 [--backend {tesseract,tesseract-auto,claude,claude-haiku,easyocr,easyocr-hy,paddle,paddle-vl,marker,vision,auto-local}]
                 [--quality-gate] [--dry-run] [--telemetry PATH]
                 [--no-telemetry] [--manifest [PATH]] [--contrast FACTOR]
                 [--psm MODE] [--auto] [--with-paddle-vl] [--format FORMAT]
                 [--pdf [PATH]] [--pdf-full-size] [--pdf-font PATH]
                 [--orient SCRIPT]

Named Arguments

--backend

Possible choices: tesseract, tesseract-auto, claude, claude-haiku, easyocr, easyocr-hy, paddle, paddle-vl, marker, vision, auto-local

Default: 'tesseract'

--quality-gate

divert transcripts below the quality threshold to workspace/triage/ (needs the qa extra; English-only scoring, skipped for other scripts)

Default: False

--dry-run

list what would be processed, without running OCR or moving anything

Default: False

--telemetry

run log to append to (default: workspace/telemetry.jsonl); one JSON object per line, tail it to watch a long batch

--no-telemetry

do not write the run log

Default: False

--manifest

beta: append a row per file to a CSV manifest (default: workspace/manifest.csv) with its transcript, the engine that read it, the quality gate’s verdict and where its files are, for a spreadsheet or a collections system’s CSV import

--contrast

Contrast factor for Tesseract (default: 2.0); try 3.0 for faded originals.

--psm

Tesseract page segmentation mode (default: 3). 3=auto, 6=block, 11=sparse.

--auto

Auto-configure Tesseract contrast and PSM per image.

Default: False

--with-paddle-vl

Add PaddleOCR-VL to the auto-local pool. It measures as the strongest local backend and wins where the rest of the pool is weakest, but costs minutes per page rather than seconds, so it is opt-in. Needs the paddle-vl extra; ignored by every other backend, which you name directly instead.

Default: False

--format, -f

output format to write, repeatable or comma-separated. Choose from: markdown, text, pdf. Defaults to markdown.

--pdf

shorthand for adding ‘pdf’ to –format: the scan with the transcript embedded as an invisible text layer, which is what makes it indexable in Preservica, CONTENTdm, Omeka and AtoM

Default: False

--pdf-full-size

embed the source image untouched instead of a downsampled access copy. Implies –pdf. Larger files; use when the PDF is the deliverable rather than a derivative

Default: False

--pdf-font

TrueType font for the text layer. Only needed for scripts the built-in font cannot encode; without one, such a transcript is refused rather than written as black boxes

--orient

Possible choices: latin, armenian

turn the page upright before reading it, judging which way is up by the named script (latin, armenian). Turned only when the reading is clear; the scan itself is never changed. Single-page files only; ‘armenian’ needs the orientation extra

triage

list what is held in workspace/triage/, or serve it as a local page

tetrak-ocr triage [-h] [--serve] [--port PORT] [--dir PATH]

Named Arguments

--serve

serve the queue as a page on http://127.0.0.1:8321/ until Ctrl-C. Loopback only: nothing remote, nothing to authenticate

Default: False

--port

port for –serve (default: 8321)

Default: 8321

--dir

the triage directory to read (default: workspace/triage/ under the working directory)

evaluate

benchmark backends against the evaluation corpus

tetrak-ocr evaluate

evaluate’s flags

evaluate uses add_help=False and forwards its arguments verbatim to evaluation.ocr.harness, which builds its argparse.ArgumentParser inline inside main() rather than in a reusable function – there is nothing here for sphinx-argparse to introspect for that one subcommand. Documented by example instead:

tetrak-ocr evaluate --backend tesseract-auto
tetrak-ocr evaluate --all --save