Magic the Gathering Deck Price Checker (mainly for JPN Players).
Consists of mtgdpc.py
and carddl.py
, which carddl.py
could be utilized independently.
mtgdpc.py
calls carddl.py
within process if -s
(--save
) argument is triggered.
Both of them supports --help
option in order to check arguments and its individual function.
cardset.py
added for searching card sets with its code, name, or playable format.
This later will be expanded to search for prices of each boxes.
MTGDPC (mtgdpc
) enables users to search the cheapest price for a given card name via Wisdom Guild.
If -s
(--save
) option is triggered, it scrapes card image contained in the decklist via:
mtgsdk
(official API)- scryfall.com (if
-h
(--high
, high-res option) is active).
-
Python 3.6 (or above)
-
Beautiful Soup
-
lxml
-
tqdm
-
requests
-
mtgsdk
Simply, pip install -r requirements.txt
to install above mentioned modules.
.txt
file of decklist must fit either Format (A) or (B).decklist/
directory contains some sample.txt
files.
Note that card name must be in English.
<# of cards> <card name>
...
Sideboard
<# of cards> <card name>
...
Also, other format will be automatically converted to this format.
If you copy and paste from M:TG Wiki, some will look like:
<deck name>[?]
土地 (#)
<# of cards> <card name [JPN]/[EN]>
クリーチャー (#)
<# of cards> <card name [JPN]/[EN]>
呪文 (#)
<# of cards> <card name [JPN]/[EN]>
サイドボード (#)
<# of cards> <card name [JPN]/[EN]>
In this case, mtgdpc
will automatically convert it and replace it with Basic Format.
$ python mtgdpc.py <.txt file>
------------------------------ MAIN DECK ------------------------------
<price> x <# of cards> = <price of card(s)> <Card Name(JPN)/(EN)>
...
main ) price: < (A) total price of main deck >
------------------------------ SIDEBOARD ------------------------------
<price> x <# of cards> = <price of card(s)> <Card Name(JPN)/(EN)>
...
side ) price: < (B) total price of sideboard >
total price (main + side): (A) + (B)
4 Tundra
4 Volcanic Island
3 City of Brass
4 Ancient Tomb
4 Tolarian Academy
4 Lotus Petal
4 Mox Diamond
4 Mana Vault
3 Voltaic Key
2 Scroll Rack
3 Mind Over Matter
4 Windfall
4 Time Spiral
3 Abeyance
3 Intuition
3 Power Sink
4 Stroke of Genius
Sideboard
4 Gorilla Shaman
4 Chill
2 Red Elemental Blast
1 Arcane Denial
4 Wasteland
This example shows when -s
(with -h
) is triggered.
Also, if you set format (e.g., -f modern
), results of cards will be reflected.
- Introduce:
- Pandas
to manage it with
DataFrames`. - Click` for better CUI experience.
- Pandas
- Handle more format of decklists.
- Refactoring for a more sophisticated structure.
- Add:
- Card info screen with capability of searching individual prices.
- Mana info such as ratio and pie.