Skip to content

Personal project · Open source · 2026

ross_tcgp

Reads my collection from the Pokémon TCG Pocket card game by driving the phone from the computer, because the game won't export it.

My role

Idea, development and open-source release, with Claude Code as a pair programmer.

Stack

  • Python
  • NumPy
  • Pillow
  • adb
  • nfpm
  • GitHub Actions

The problem

To build decks with AI I needed the list of my cards, and the game has no way to export it. Checking 900+ cards by eye wasn't an option, so I made the computer drive the phone: it takes screenshots over adb, finds the grid, recognizes each card and reads how many copies I have.

Highlights

  1. 01937 cards (393 different) in about 5 minutes, with the exact total the game shows; --quick mode checks only what's new in ~15 s.
  2. 02Recognizes each card with a 16×22 color fingerprint against 4,577 references in a single matrix product: under a millisecond.
  3. 03No fixed coordinates (the grid comes from the game's light blue background) and copy counts read with its own templates instead of OCR.
  4. 04Scrolling that doesn't skip rows: a swipe left the list gliding by inertia; now the finger holds still before lifting, and pages are joined by cards, not pixels.
  5. 05Exports CSV for PackProphet and the TCG Pocket Collection Tracker format; packages for pacman, APT and DNF tested on 6 distros.

What I learned

  • → 01Color decides: a greyscale perceptual hash mixes up prints of the same artwork; a color fingerprint tells them apart.
  • → 02For a single font, templates beat OCR: simpler, more accurate and with no system dependencies.
  • → 03Keeping the screenshots and being able to rebuild a scan without the phone let me tune the code without repeating 5-minute scans.

Posts about this project

Next project

ross_fisheye →

← Back