Closed silasary closed 7 years ago
I'd be happy to send a PR to implement an alternate decklist parser, but I'd rather wait until you refactor to a point where you're happy with it. Otherwise I'm likely to have serious merge conflicts.
thanks for the feedback! I started working on the .txt parser, which I agree should have been the first method I should have implemented. The current iteration is leftover from v0.1 where I manually entered CMC's after each card name.
As for the .dek format, this does not look that bad, it seems: find the lines that include "Quantity", check if they are main/sideboard, and grab the card name. Will add this format to the queue.
I think I coded the workaround for the default decklist, at least the mainboard. Still testing it. Not sure how the sideboard should be handled: separate file? side-by-side with mainboard? skipped altogether?
I will upload the new version of the script and update the README later tonight, after more testing.
Just started looking into reading the .dek format, turns out there is an XML format parser readily available in python! Testing it out, looks promising.
The biggest thing then for the main script is going to be inserting "if" statements to ensure the proper format is being read based on the input file...
Closed by #8
Magic Online has two major export formats.
.txt
, which formats lines as#NN <Cardname>
, with a single blank line between mainboard and sideboard. This is a simple format, and should be supported..dek
, an xml-based format. It's more verbose, and uses internal card ids to store which printing each card refers to. It's much more complicated to parse, and can be safely ignored.