taw / magic-preconstructed-decks

Magic: the Gathering Preconstructed Decks
7 stars 10 forks source link

Plan for this repository #1

Closed taw closed 6 years ago

taw commented 7 years ago
fenhl commented 7 years ago

A reasonable JSON format might look something like this:

Deck Name.json

{
    "Card Name 1": "SET",
    "Card Name 2": {
        "set": "SET",
        "number": 123,
        "count": 10
    },
    ⋮
}

With the collector number for cards that appear multiple times in the set (e.g. basic lands), and count for cards that appear multiple times in the deck.

taw commented 7 years ago

Right now we can do something like Liliana, Death Wielder.json:

{
    "name": "Liliana, Death Wielder",
    "type": "Planeswalker Deck",
    "set_name": "Amonkhet",
    "set_code": "AKH",
    "cards": [
       {
         "name": "Swamp",
         "count": 11,
         "set_code": "AKH"
       },
       ...
    ],
   "sideboard": []
}

Set from which each card is will generally be possible to infer (since normally all cards are from same set, exceptions like Coldsnap Theme Decks are rare).

I don't think there's any reasonable way to figure out which card variant is included. Decklists on wizards site don't have it.

Gatherer set codes should be enough, are there any precons with sets not on Gatherer?

fenhl commented 7 years ago

If there are, we can just use MTG JSON set codes.

fenhl commented 7 years ago

We can figure out variants for some of the decks by looking at unboxing videos (this is something I have done before to document token cards included in a deck) and add them manually to those decks.

taw commented 7 years ago

There's over 400 precon decks, looking at unboxing videos is not terribly realistic.

taw commented 7 years ago

You can try bundle exec bin/build_jsons > decks.json now.

I just discovered that all Commander decklists script got are missing commander. Oh well.

taw commented 7 years ago

Mass import got to 109 decks already (they still need some cleanup, like missing commanders, and *), and it even does usable json export. I think this project can go somewhere useful.

taw commented 7 years ago

So we now have 536 decklists with validated card names and JSON export (as described by README).

It's definitely the highest quality machine readable source of this information anywhere.

There's some minor silliness like deck name capitalization (many are ALL UPPERCASE on wizards site), but it's really all ready for use by mtg.wtf, or any other program which might want to do so.

What's not included: any information which card version (set and variant) it actually is. With that many decklists I wanted to keep the scope realistically bound. At some point I might write tooling to deal with at least some of these (like Commander decks version is totally obvious), and then we'll see how many cases would be left over.

taw commented 6 years ago

It all works now. I'm sure there are mistakes somewhere, but it's great success!