Skip to main content

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

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

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

chesspdf-0.1.0.tar.gz (44.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

chesspdf-0.1.0-py3-none-any.whl (54.7 kB view details)

Uploaded Python 3

File details

Details for the file chesspdf-0.1.0.tar.gz.

File metadata

  • Download URL: chesspdf-0.1.0.tar.gz
  • Upload date:
  • Size: 44.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for chesspdf-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1faa5d054d4571375e9c208541cbae4794331d1e0de65b603baa9a64dbdd3ec3
MD5 8ae14f5a15228d2131311835fc2dd104
BLAKE2b-256 32ed3f6a1c6c4e4a23c9d8d38caa8cbaa1967dd70e13f144218b8b45dcfbc3d6

See more details on using hashes here.

File details

Details for the file chesspdf-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: chesspdf-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 54.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.8

File hashes

Hashes for chesspdf-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3a7a248087790a96917172122241084422c12812fda04b7bb4b51b45c3ad629d
MD5 0a1d3e4c65d2c74cad6b3bca941956d8
BLAKE2b-256 f3056ae17d4559983d1eb809a89c3c6f7a331bc4e13d8236c7a55b473cd88e15

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.1

2 files

0.2.0

2 files

0.1.1

2 files

This release

0.1.0 This release

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page