ScriptAIX
AI-assisted transcription of historical handwriting.
What is ScriptAIX?
ScriptAIX is a small Python tool that turns scanned handwritten documents into readable, searchable text. You point it at a folder of scans or PDFs, and it sends each page to Claude, Anthropic's large language model, together with a carefully tuned expert prompt. The result is a diplomatic transcription: the original spelling, punctuation and line breaks are preserved, nothing is modernised, nothing is guessed. Every page ends up as a Markdown file, and an interactive viewer shows the scan and the transcription side by side.
Why it exists
It started with my genealogy research. The archives of Zeeuws-Vlaanderen and East Flanders are full of documents I wanted to read: 19th-century memories van successie (estate inventories), notarial deeds, 17th-century marriage registers, Flemish parish registers written in church Latin, private letters from the 1600s, and German family letters in Kurrent and Sütterlin script.
Reading these takes real palaeographic skill, and even with practice it is slow, tiring work. Modern multimodal AI models turned out to be remarkably good at it, provided you give them precise instructions about the document type, the region, the period and the transcription conventions. ScriptAIX packages exactly that into a repeatable workflow: scan in, faithful transcription out, with every uncertainty honestly marked.
How it works
ScriptAIX is a single Python script driven from the command line. It accepts JPG, PNG, WebP, multi-page TIFF and PDF files (with three interchangeable PDF backends), fixes image orientation, scales pages to the optimal resolution and sends them to the Anthropic API. Pages are loaded lazily, so even large PDF volumes do not fill up memory. Failed pages are retried automatically, already transcribed pages are skipped on the next run, and duplicate file names in different subfolders are resolved automatically.
Each transcription is saved as a Markdown file with a metadata header: source file, date, model, prompt preset and token usage. A run ends with a cost summary, so there are never surprises on the API bill.
Expert prompts per document type
The quality stands and falls with the prompt. ScriptAIX ships with a library of presets, each written for one document type and one script tradition:
- dutch-19th: 19th-century Dutch administrative handwriting
- memories-van-successie: Dutch estate inventories, with attention to heirs, assets and amounts
- ondertrouw-zeeuws-vlaanderen-17e-eeuw: 17th-century marriage and banns registers from Zeeland
- assendelft: early modern Dutch private correspondence (ca. 1600 to 1800), including text written sideways in the margins
- kerklatijn-meetjesland-18e: Flemish parish registers in church Latin
- suetterlin: German Kurrent and Sütterlin script
- kirchenbuch: German, Latin and Dutch church books
- general: a sensible default for everything else
All presets enforce the same conventions: uncertain readings are marked
[?], illegible passages [onleesbaar], marginal notes
[kantlijn: ...], strikethrough and insertions are preserved, and
the model may append a short remarks block when something about the page is
worth noting. Custom prompts can be added as simple JSON, no code changes
needed.
The interactive viewer
Every run generates viewer.html: scan on the left, rendered
transcription on the right. It offers zoom and pan on the scan, full-text
search across all pages, colour-coded badges for uncertain and illegible
passages, highlighted marginal notes and remarks, and metadata pills showing
date, model, prompt and token count for each page.
The viewer doubles as an editor. Started with --serve, a local
web server (bound to localhost only) lets me proofread and correct
transcriptions directly in the browser. Saving writes the .md file and keeps
a backup, a restore button undoes mistakes, and a reload button picks up
pages transcribed while the viewer is open. The transcription data lives in a
separate scriptaix.json, ready for other tools to consume.
Built for larger archives
For bigger collections there are three cost and throughput features. A dry
run (--dry-run) lists all pending pages and estimates the cost
before anything is sent, using exact token counting on sample pages. Batch
mode (--batch) routes the whole run through Anthropic's Message
Batches API at half price; the batch state is saved on disk, so the wait can
be interrupted and resumed at any time without paying twice. And parallel
mode (--threads) speeds up interactive runs, with the first page
run separately to warm up the prompt cache.
Honest limits
ScriptAIX does not replace the palaeographer, it replaces the first draft. The model misreads names, numbers and faded passages just like a human does, which is why every uncertain reading is marked and why the viewer makes proofreading against the original scan as painless as possible. For my purposes, checking a good draft is many times faster than deciphering from scratch, and that is the entire point.
ScriptAIX is a personal tool and not (yet) published. If you are curious about it, email me.