gitwtfhub

wtf is pageledger?

peterbussch/pageledger — explained in plain English

Analysis updated 2026-05-18

8PythonAudience · researcherComplexity · 3/5Setup · easy

TL;DR

A command line tool that tracks cost, quality, and provenance for OCR and document extraction runs, so results can be audited later.

Mindmap

mindmap
  root((PageLedger))
    What it does
      Tracks OCR runs
      Records cost and quality
      Flags weak pages
    Tech stack
      Python
      Tesseract
      CLI
    Use cases
      Archive digitization
      Rerun weak pages
      Audit methodology
    Audience
      Archivists
      Historians
      Researchers

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Track exactly which OCR engine and settings processed each page in a large scanned document batch.

REASON 2

Flag pages with low OCR confidence and automatically build a rerun plan using a stronger engine.

REASON 3

Produce an auditable cost and provenance record to cite when defending an extraction methodology later.

REASON 4

Check extracted table data against an expected schema and catch problems like duplicate headers.

What's in the stack?

PythonTesseractCLIOCR

How it stacks up

peterbussch/pageledger100/awesome-machine-learningadam-s/car-diagnosis
Stars888
LanguagePythonPythonPython
Last pushed2024-08-07
MaintenanceStale
Setup difficultyeasyeasymoderate
Complexity3/51/53/5
Audienceresearcherdeveloperresearcher

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 30min

Needs a locally installed OCR engine like Tesseract and poppler for the default pdf_ocr adapter.

No license terms are given in the README excerpt.

Wtf does this do

PageLedger is a command line tool for tracking exactly what happened when you run OCR or document extraction on a large batch of pages. It was built for people who need to answer questions months later, such as which software engine processed a specific page, how much a run cost, which pages were too noisy to trust, and which ones still need a human to look at them. You bring your own extraction engine, Tesseract, Docling, Marker, or a cloud vision language model, and PageLedger wraps the run, enforces budgets on pages, tokens, and dollars, and writes everything it learns as plain files on disk that you can search, cite, or use to reconstruct exactly how a result was produced. There is no server and no database involved. The project began as part of a Soviet census digitization effort, where getting a model to return structured JSON was only the start of the real work of trusting that output. It is aimed at digital humanities labs, archives, historians, and anyone else who has to defend their extraction methodology later. To use it, you install it with pip and run a command pointing at a scanned PDF, using a built in adapter for plain text, born digital PDFs, or scanned PDF OCR. Each run produces a folder holding the extracted text alongside a manifest, per page evidence of where the text came from, quality warnings, OCR confidence scores, cost records, and a queue of pages flagged for review. If some pages come back weak, you can rerun just those pages through a stronger engine and compare the two runs directly. Under the hood, PageLedger classifies each page's structure, tracks quality signals such as low confidence text or likely mismatched historical spelling, grades each page from A to F with the reasoning behind the grade, and can quarantine or automatically rerun pages based on rules you set. It also checks that extracted table data lines up with the schema you expect, flagging duplicate headers or uneven rows rather than silently fixing them. The tool ships with tests and documentation aimed at both human users and AI coding agents that might operate it directly.

Yoink these prompts

Prompt 1
Help me install PageLedger and run OCR on a scanned PDF using the pdf_ocr adapter.
Prompt 2
Show me how to rerun only the low confidence pages from a PageLedger run through a stronger engine.
Prompt 3
Explain how to compare two PageLedger runs to see what changed after a rerun.
Prompt 4
Walk me through setting up PageLedger's page, token, and dollar budgets for a large OCR batch.

Frequently asked questions

wtf is pageledger?

A command line tool that tracks cost, quality, and provenance for OCR and document extraction runs, so results can be audited later.

What language is pageledger written in?

Mainly Python. The stack also includes Python, Tesseract, CLI.

What license does pageledger use?

No license terms are given in the README excerpt.

How hard is pageledger to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is pageledger for?

Mainly researcher.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.