Local Magic: The Gathering collection tracker. Imports card data from mpcfill.com XML exports into a SQLite database, with Google Sheets sync planned.
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txtDrop your mpcfill XML (or plaintext TXT) file into data/imports/, then:
python3 scripts/import_xml.py data/imports/order.xmlThe file is moved to data/imports/processed/ after a successful import.
The database is created automatically at data/mtg.db.
Options:
# Assign a label (default: Proxies)
python3 scripts/import_xml.py data/imports/order.xml --label Official
# Clear the order plan after importing (use when a full order has arrived)
python3 scripts/import_xml.py data/imports/order.xml --clear-planCreate a plain text deck list file in the standard format:
Deck
4 Lightning Bolt
2 Counterspell
Sideboard
2 Rest in Peace
Then run:
python3 scripts/check_deck.py path/to/deck.txtThis writes two files to data/output/:
<deck>_missing.txt— cards you still need, ready to upload to mpcfillorder_check.html— combined visual report for all decks checked this session
Notes:
- Basic lands (Island, Plains, Swamp, Forest, Mountain) are always skipped
- Cards appearing in both mainboard and sideboard are counted once with combined quantity
Use --plan to track missing cards across several deck checks so the same card is never ordered twice.
# Check deck 1 — missing cards are added to the order plan
python3 scripts/check_deck.py deck1.txt --plan
# Check deck 2 — cards already in the plan show as "Covered by order plan"
python3 scripts/check_deck.py deck2.txt --plan
# View the consolidated order plan
python3 scripts/order_plan.py
# After placing the order and importing the new cards:
python3 scripts/order_plan.py --clearEach deck produces its own _missing.txt for separate upload. The order_check.html is updated after every check and shows all decks in one view.
sqlite3 data/mtg.db "SELECT name, label, quantity FROM cards ORDER BY name;"mtg/
db.py SQLite schema + query helpers
importer.py mpcfill XML and plaintext TXT parser
deck_check.py deck vs. collection comparison + HTML/TXT output
order_plan.py persistent order plan (data/order_plan.txt)
sheets.py Google Sheets sync (stub, not yet implemented)
scripts/
import_xml.py import a card file into the DB
check_deck.py check a deck list against the collection
order_plan.py view or clear the active order plan
data/
imports/ drop files here to import (gitignored)
imports/processed/ files moved here after import (gitignored)
mtg.db SQLite database (gitignored)
order_plan.txt active order plan (gitignored)
output/ generated missing lists and HTML reports (gitignored)