filter_collection
Filter your enriched Lorcana collection CSV by format legality to see which owned cards are playable, grouped by ink color.
Instructions
Filter an enriched collection CSV down to the cards you own that are legal in a specific play format — answers "which of my cards can I actually play in format X", grouped by ink color with owned quantities.
Legality data comes from a live duels.ink fetch, which tracks Core EN, Infinity, Core ZH, and Core JA rotation. Poorcana (Common/Uncommon only, 50-card min) is the one exception: it's derived purely from the CSV's own Rarity column, no external lookup, so it still works offline and always reflects the CSV's rarity data exactly.
Behavior: promo rows (Set Name == "Disney Lorcana Promo Cards") are always
excluded from Core/Infinity/regional results, not flagged as illegal —
duels.ink's legality table is keyed by (set, number) and promos don't map
onto that cleanly (see "Promo cards" in the reference doc). Any other row
duels.ink doesn't recognize (usually a card from a set duels.ink hasn't
indexed yet) is silently skipped and counted in a "rows skipped" footer —
that's a data-lag note, not a legality verdict, so don't read a skipped
row as "illegal". Requires the enriched CSV's columns (Set Name, Number,
Ink, Ink Cost, Add to Quantity, etc.) — running this against the raw
TCGPlayer export (pre-enrich_csv) will silently undercount or return
nothing useful.
Usage guidelines: run this when you want to see your full legal card pool
for a format before hand-building a deck, or to sanity-check whether a
deck idea is even feasible with what you own. If you want a finished
decklist rather than just the eligible pool, use build_deck with
mode="collection" instead — it already applies this same legality
filter internally as part of assembling a curve-balanced list, so you
don't need to call both.
Args: csv_path: Absolute path to an enriched Lorcana collection CSV. format: "core", "infinity", "core_zh", "core_ja", or "poorcana".
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| format | No | core | |
| csv_path | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |