CLI and web app to look up Pokemon cards across open data sources, fetch images and prices, and emit an .xlsx, PDF binder, set-completion checklist, and JSON report for card-show prep.
Project description
🌐 Project site: https://mgz-pkmn.com · 🚀 Live demo: https://mgz-pkmn.onrender.com
A toolkit for prepping Pokemon card binders for a card show: take a list
of cards, look each one up across three open data sources, download
images, and write an .xlsx with embedded thumbnails, current market
price, and 80 / 85 / 90 / 95 % negotiation comps. Optional PDF binder,
condensed binder, set-completion checklist, and JSON report alongside.
Two ways to drive it:
- CLI —
./pkmn lookup cards.txtproduces xlsx + (optional) PDF + JSON;./pkmn set-cardsemits printable set ID cutouts. - Web UI — FastAPI backend in api/ and a React + Vite frontend in web/ put the same pipeline behind a live in-browser interface with streaming results and one-click export.
The tool tries sources in this order:
- pokemontcg.io — primary. Best coverage of English / international English releases, with TCGPlayer (USD) + Cardmarket (EUR) prices.
- TCGdex — multilingual fallback (
en,ja,ko,zh-tw,zh-cn,de,fr,es,it,pt, …). Has Cardmarket prices for many cards. - PriceCharting — opt-in via an explicit URL on the line. Ideal for region-exclusive products neither aggregator indexes (Chinese Gem Pack, etc.). Returns USD loose / new / graded prices.
Install
Requires Python 3.11+ and uv.
brew install uv # macOS
curl -LsSf https://astral.sh/uv/install.sh | sh # any platform
make install-cli # CLI only — fastest
# or
make install # CLI + API + web + pre-commit hook
Run make help for the full target list.
Quickstart
./pkmn lookup input/ --no-images \
-o output/cards.xlsx \
--pdf output/binder.pdf \
--condensed-pdf output/binder-condensed.pdf \
--checklist output/checklist.pdf \
--report-json output/summary.json
./pkmn set-cards -o output/set-cards.pdf # printable set ID cutouts (no input needed)
The bundled input/ directory ships four small example lists
that exercise every input syntax and lookup mode the tool supports —
including example-url-overrides.txt,
which walks through the "paste a PriceCharting URL once and forget it"
workflow. The tracked files in output/ were generated by
exactly the command above. See the CLI reference
for the full breakdown.
API key (optional but recommended)
The pokemontcg.io API works without a key (~1000 requests/day, 30/min) but a free key raises that to 20k/day. Grab one at https://dev.pokemontcg.io, then set it as an env var:
export POKEMONTCG_IO_API_KEY=your-key-here # current shell
echo 'export POKEMONTCG_IO_API_KEY=your-key-here' >> ~/.zshrc # persistent
Prefer the env var over --api-key — flags get saved to shell history.
Environment variables
Every variable the tool reads, in one place:
| Variable | Purpose |
|---|---|
POKEMONTCG_IO_API_KEY |
Raises pokemontcg.io rate limits from 1k/day to 20k/day. Free key at https://dev.pokemontcg.io. |
MGZ_PKMN_NO_CACHE |
Disables the disk cache for the current process. The CLI's --no-cache flag sets this internally. |
MGZ_PKMN_CACHE_WARN_BYTES |
Threshold for the cache-size soft-warn at startup (default 50 MB, 0 disables). |
XDG_CACHE_HOME |
Overrides the cache root ($XDG_CACHE_HOME/mgz-pkmn). Standard XDG semantics. |
See docs/cache.md → Environment variables for the full behavior of the cache-related vars.
Web UI
make install # one-time setup
make dev-api # Terminal 1 — API on :8000
make dev-web # Terminal 2 — Vite dev server on :5173
Open http://localhost:5173. The Vite dev server proxies /api/* to
the FastAPI server. Swagger UI lives at http://localhost:8000/docs.
Prefer not to install anything? The same UI is hosted at https://mgz-pkmn.onrender.com.
For deeper docs (endpoint reference, troubleshooting, architecture), see api/README.md and web/README.md.
License
Released under the MIT License.
Documentation
Reference docs live under docs/ and are mirrored to the
GitHub Wiki on every
push to main.
| Topic | Page |
|---|---|
Every flag and pkmn invocation pattern |
CLI reference |
Single-card + bulk top:N / All … syntax |
Input format |
| pokemontcg.io / TCGdex / PriceCharting layering | Sources & coverage |
| Non-English / regional handling | Languages |
| Spreadsheet + JSON report shape | Outputs |
| Standard 3×3 + condensed 6×4 layouts | PDF binder |
| Front-of-binder set checklist | Checklist PDF |
| Disk cache + URL overrides | Cache |
| Render / Docker / production recipe | Deployment |
| Marketing site (Astro + Tailwind, Cloudflare Pages) | site/README.md |
| Project layout, dev workflow, CI, release | Contributing |
Community
Questions, ideas, or want to share what you built? Open a thread in GitHub Discussions.
Project details
Release history Release notifications | RSS feed
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 mgz_pkmn-1.3.1.tar.gz.
File metadata
- Download URL: mgz_pkmn-1.3.1.tar.gz
- Upload date:
- Size: 1.8 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1efcc7c9bf0a09208d55d2d5778bd4abdcaf03fa1bc95a481845ce99462c3844
|
|
| MD5 |
b3dab5ffcc576eccc80b6d474e089d11
|
|
| BLAKE2b-256 |
82df9f77a9ca9149143242e6cfc1b8032e55cdb51db01ec250edc31fd371b020
|
Provenance
The following attestation bundles were made for mgz_pkmn-1.3.1.tar.gz:
Publisher:
release.yml on mgzwarrior/mgz-pkmn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mgz_pkmn-1.3.1.tar.gz -
Subject digest:
1efcc7c9bf0a09208d55d2d5778bd4abdcaf03fa1bc95a481845ce99462c3844 - Sigstore transparency entry: 1706708803
- Sigstore integration time:
-
Permalink:
mgzwarrior/mgz-pkmn@0c5c5cbe93af579d251145089285f301f2f3490f -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/mgzwarrior
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c5c5cbe93af579d251145089285f301f2f3490f -
Trigger Event:
push
-
Statement type:
File details
Details for the file mgz_pkmn-1.3.1-py3-none-any.whl.
File metadata
- Download URL: mgz_pkmn-1.3.1-py3-none-any.whl
- Upload date:
- Size: 111.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e386905cba917b94895dd024b831a6e796c10fb4187b0e92458dd85d3db5a159
|
|
| MD5 |
9aac4488cf1a48c141a1511a6758129e
|
|
| BLAKE2b-256 |
4432527536118271976ddbda0fb28c365c74570a73c5c467dcaf5bbadc67f484
|
Provenance
The following attestation bundles were made for mgz_pkmn-1.3.1-py3-none-any.whl:
Publisher:
release.yml on mgzwarrior/mgz-pkmn
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mgz_pkmn-1.3.1-py3-none-any.whl -
Subject digest:
e386905cba917b94895dd024b831a6e796c10fb4187b0e92458dd85d3db5a159 - Sigstore transparency entry: 1706708840
- Sigstore integration time:
-
Permalink:
mgzwarrior/mgz-pkmn@0c5c5cbe93af579d251145089285f301f2f3490f -
Branch / Tag:
refs/tags/v1.3.1 - Owner: https://github.com/mgzwarrior
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0c5c5cbe93af579d251145089285f301f2f3490f -
Trigger Event:
push
-
Statement type: