chesspdf
Convert chess puzzle books you own — PDF in, replay-verified PGN out.
Point it at a chess book PDF and get four PGN files: a spoiler-free problems file (one position per puzzle, with the book's hint as a comment), a solutions file, and verified/review splits. Works on both born-digital PDFs (boards typeset in a chess font — decoded deterministically, zero API calls) and scanned books (vision recognition via the Gemini API).
Why trust the output
Vision models misread chess diagrams too often to trust. chesspdf never does: a position is accepted only when the book's own printed solution replays legally from it (python-chess). Failures go through deterministic repair passes; the small residue lands in a human review web app instead of silently shipping wrong. Every puzzle carries a ledger of how its data was obtained and verified.
Measured across three complete books (2,266 puzzles): born-digital books verify at ~100% with zero API calls; scanned books reach ~90% machine-verified before any human review.
Install
uv tool install chesspdf # or: pipx install chesspdf
export GEMINI_API_KEY=... # only needed for scanned books
Try it in one minute
chesspdf sample --out sample_book.pdf # a CC0 book + its answer key
chesspdf probe probe sample_book.pdf # what kind of book is this?
sample typesets 100 puzzles from the Lichess database (CC0) as a real
exercise book — numbered diagrams, hints, a solutions section in algebraic
notation — and writes truth.json beside it. Because the answers are known,
chesspdf score grades a pipeline run outright instead of asking you to
check it.
Quickstart
# 1. What kind of book is this?
chesspdf probe probe mybook.pdf # JSON: born-digital or scanned,
# fonts, candidate puzzle pages
# 2. Render a few pages and look at the layout
chesspdf probe render mybook.pdf ./pages 10 11 300
# 3. Run the pipeline for your book folder (see docs/DEVELOPMENT.md)
chesspdf --book books/mybook audit # replay-verify everything
chesspdf --book books/mybook fix-fens # repair failing positions
chesspdf --book books/mybook fix-moves # repair broken solutions
chesspdf --book books/mybook review # human review web app
Or let an agent do it
The plugin/ directory packages this workflow as an agent skill
(onboard-book) for Claude Code, Codex CLI, Antigravity CLI, and pi: install
the CLI once, copy one directory into your agent host, then just say "use
onboard-book to convert mybook.pdf". The agent probes the PDF, picks a
pipeline, tunes layout parameters against the built-in verification oracle,
and hands you only the residue. See
plugin/INSTALL.md.
Legal
chesspdf is a personal-use format conversion tool: use it on books you own, for your own study. Do not redistribute extracted positions, solutions, or any other book content. This repository and the published package contain code only — no book content.
More
docs/DEVELOPMENT.md— pipeline internals, the bundle state machine, measured lessons (error taxonomy, prompt A/B results, CV cross-check accuracy)plugin/skills/onboard-book/SKILL.md— the distilled onboarding playbook agents follow
MIT © Zilin Du
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 chesspdf-0.2.1.tar.gz.
File metadata
- Download URL: chesspdf-0.2.1.tar.gz
- Upload date:
- Size: 89.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ea9ea328d994e619271b79a23f67bab0a7beb3987eeffe001d6c3b6899701cb5
|
|
| MD5 |
56f123fa6047f9b45adbf4d5016914ab
|
|
| BLAKE2b-256 |
e1e4a6516e4d76e39d1ba0e316dbfccdb83e8fa45ddab9782165fcd0d9561dd9
|
Provenance
The following attestation bundles were made for chesspdf-0.2.1.tar.gz:
Publisher:
release.yml on zilin/chesspdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chesspdf-0.2.1.tar.gz -
Subject digest:
ea9ea328d994e619271b79a23f67bab0a7beb3987eeffe001d6c3b6899701cb5 - Sigstore transparency entry: 2495003285
- Sigstore integration time:
-
Permalink:
zilin/chesspdf@bc833a019a4777fef550a692d8596f3041c55542 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/zilin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bc833a019a4777fef550a692d8596f3041c55542 -
Trigger Event:
push
-
Statement type:
File details
Details for the file chesspdf-0.2.1-py3-none-any.whl.
File metadata
- Download URL: chesspdf-0.2.1-py3-none-any.whl
- Upload date:
- Size: 109.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c63575c2f3d56249817ba9e8562e73724f59e3d7fccefb8395395185fe8cd645
|
|
| MD5 |
dbdc4386e466d186318415e8218d1ed4
|
|
| BLAKE2b-256 |
37d0913d180f0db27f48eecd48207a1ecb428724148ac3b9c7d2812c6e2264df
|
Provenance
The following attestation bundles were made for chesspdf-0.2.1-py3-none-any.whl:
Publisher:
release.yml on zilin/chesspdf
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
chesspdf-0.2.1-py3-none-any.whl -
Subject digest:
c63575c2f3d56249817ba9e8562e73724f59e3d7fccefb8395395185fe8cd645 - Sigstore transparency entry: 2495003293
- Sigstore integration time:
-
Permalink:
zilin/chesspdf@bc833a019a4777fef550a692d8596f3041c55542 -
Branch / Tag:
refs/tags/v0.2.1 - Owner: https://github.com/zilin
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@bc833a019a4777fef550a692d8596f3041c55542 -
Trigger Event:
push
-
Statement type: