enrich_csv
Enrich a raw TCGPlayer Lorcana CSV with full card data, adding ink color, cost, type, stats, and abilities. Outputs enriched and dreamborn-ready CSVs for collection analysis and deck building.
Instructions
Enrich a raw TCGPlayer Lorcana CSV export with full card data — the
required first step before any other tool here can read your collection
(filter_collection, audit_csv, what_am_i_missing, build_deck, and
find_song_synergies's collection_csv all expect this tool's output,
not the raw TCGPlayer export).
Fetches card data from LorcanaJSON (sets 12+) and lorcana-api.com (sets
1–11) and adds Ink color, Ink Cost, Card Type, Subtypes, Strength,
Willpower, Lore Points, Inkable, Keywords, and Abilities to each row. Both
sources are disk-cached 24h, so a second run soon after the first is
fast regardless of cache_path.
Behavior: writes two new files next to the input — never modifies
input_path itself — and always reports fill-rate stats per column plus
any cards it couldn't match (usually a name typo in the export, or a
brand-new card the APIs haven't indexed yet). Promo cards (Set Name
"Disney Lorcana Promo Cards") are matched by name against their
non-promo equivalent for stats, and separately resolved to a
dreamborn.ink-importable (Set Number, Card Number) row when this
server's built-in promo table covers that card; promos it doesn't
recognize are listed for manual entry rather than guessed. cache_path
only skips re-fetching for card names already present in that prior
enriched CSV — it does not skip enrichment for new cards in the input.
Writes two output files next to the input: enriched_{filename} — enriched collection CSV dreamborn_{filename} — import-ready CSV for dreamborn.ink
Usage guidelines: run this on every fresh TCGPlayer export before doing
anything else with it. Pass cache_path pointing at your previous
enriched CSV on a re-export to speed things up — otherwise every row
re-fetches from the API even for cards you've already enriched before.
Use refresh_prices=True specifically to bring an existing enriched
CSV's prices current without a fresh TCGPlayer export (it only touches
the price column, not the card-data columns); leave it off for a
same-day fresh export, since the TCGPlayer download already has current
prices and refreshing adds an extra tcgcsv.com call per row.
Args: input_path: Absolute path to the raw TCGPlayer CSV export. cache_path: Optional path to a previous enriched CSV to speed up re-runs by skipping API calls for cards already seen. refresh_prices: If True, overwrite each row's TCG Market Price with a live tcgcsv.com lookup for that exact printing, instead of leaving whatever the raw TCGPlayer export had at download time. Use this to bring an old enriched CSV's prices current without re-exporting from TCGPlayer.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cache_path | No | ||
| input_path | Yes | ||
| refresh_prices | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |