Draft listing pipeline
Input: a stack of cards in the flatbed. Output: rows in data/inventory.json
with status: draft and a saved draft listing per card. Publishes nothing.
Procedure
- Scan each card at ≥ 600 dpi, color. One card per pass.
scanimage --device "$SCANNER" --resolution 600 --format=png -o card.png - Normalize — deskew, crop to the card border, resize to 800 px on the long edge, white balance. Reject and re-scan if the border is not detected.
- Identify —
auto_card_processor.pyruns vision for name + set symbol. Confirm against Scryfall by exactset+collector_number; if the number is illegible, match name + set and flagneeds_human: id. - Condition — never self-assign NM from a photo. Default
Near Mintonly if the card is from a sealed box and unplayed; otherwiseLightly Playedand note the defect. This is the number Chris gets in trouble for. - Price —
tcgplayer_price_lookup.py:- list at
marketfor cards > $5; - list at
market + 8 %for cards < $5 to absorb fees; - refuse to list under $1 net (bin them into a bulk lot instead).
Store
market,low,mid,priced_at(UTC), andsource_url.
- list at
- Draft — title
MTG <Name> <Set> <#/total> <Rarity> <Condition>; item specifics from Scryfall; photos = front, back, corner close-up; shipping policy per card class; quantity 1. - Write the row —
{sku, name, set, collector_number, condition, price, cost_basis, listing_id, status: draft, scanned_at}. - Report — one line per card: name, price, and flags. Then a batch summary: count, gross if all sell, total fees, net.
Stop conditions
- Vision confidence < 0.8 →
needs_human, do not guess a printing. - Price lookup fails → leave
price: null, card stays draft. A guessed price is worse than a missing one. - Duplicate SKU already listed → merge quantity, do not create a second listing.


