Skip to main content

Find magic cards based on the Name on the card.

Project description

Generic badge made-with-python Build Status PyPi Version

MTG_Card_Identifier

MTG_Card_Identifier is a python based program to identify Magic: The Gathering cards based on the Card name in the image that the user uploads.


    __  ___  ______   ______          ______                       __
   /  |/  / /_  __/  / ____/         / ____/  ____ _   _____  ____/ /
  / /|_/ /   / /    / / __          / /      / __ `/  / ___/ / __  /
 / /  / /   / /    / /_/ /         / /___   / /_/ /  / /    / /_/ /
/_/  /_/   /_/     \____/          \____/   \__,_/  /_/     \__,_/

    ____       __                 __     _     ____    _
   /  _/  ____/ /  ___    ____   / /_   (_)   / __/   (_)  ___    _____
   / /   / __  /  / _ \  / __ \ / __/  / /   / /_    / /  / _ \  / ___/
 _/ /   / /_/ /  /  __/ / / / // /_   / /   / __/   / /  /  __/ / /
/___/   \__,_/   \___/ /_/ /_/ \__/  /_/   /_/     /_/   \___/ /_/

   _____                   _             __     __
  / ___/  _____   _____   (_)    ____   / /_   / /
  \__ \  / ___/  / ___/  / /    / __ \ / __/  / /
 ___/ / / /__   / /     / /    / /_/ // /_   /_/
/____/  \___/  /_/     /_/    / .___/ \__/  (_)
                             /_/

Installation

Linux

# Run the install.sh script
$ sudo sh install.sh

Windows

  • Run:
> pip3 install -r requirements.txt
  • May have to install Tesseract from here

PIP

pip install MTG-Card-Identifier

Usage

# change into the script directory 
cd MTG_Card_Identifier
$ python3 main.py -img IMAGE [-url URL] [-dir DIR] [-batchFile BATCHFILE] [-p PERCENT] [-ci CI] [-show SHOW]

MTG_Card_Identifier: Find magic cards based on the Name on the card.

optional arguments:
  -h, --help            show this help message and exit
  -url URL, --URL URL   Tell the script that the -img is a url. Usage [ -url y ]
  -dir DIR, --DIR DIR   Batch directory check the script that the -dir is a directory. Usage [-dir y]
  -batchFile BATCHFILE, --BatchFile BATCHFILE
                        Batch File will process the contents. The args tell us if its local or remote.
  -p PERCENT, --Percent PERCENT
                        Enter the percent you want the comparison to be [whole numbers].
  -ci CI, --CI CI       Print out more information about a card if the script is 100 percent a match. 
                        [y or n]
  -show SHOW, --Show SHOW
                        Show guessed image. [y or n]

required named arguments:
  -img IMAGE, --Image IMAGE
                        Insert path to the Image here.

Batch File format

txt File

Just links for either local paths or URLs.

https://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=916&type=card

CSV Files

A header line then just links for either local paths or URLs.

header
https://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=916&type=card

Sets included:

Set Name Cards Available Total Cards in Set Set Name Cards Available Total Cards in Set
Arabian Nights 92 92 Lorwyn 301 301
Antiquities 100 101 Morningtide 150 150
Legends 310 310 Shadowmoor 301 302
The Dark 119 122 Eventide 180 180
Fallen Empires 187 187 Shards of Alara 249 249
Ice Age 383 383 Conflux 145 145
Homelands 140 140 Alara Reborn 145 145
Alliances 199 199 Worldwake 145 145
Mirage 350 351 Rise of the Eldrazi 248 248
Visions 167 167 Scars of Mirrodin 249 249
Weatherlight 167 167 Mirrodin Besieged 155 155
Tempest 350 350 New Phyrexia 175 175
Stronghold 143 143 Innistrad 284 284
Exodus 143 143 Dark Ascension 171 171
Urza's Saga 350 356 Avacyn Restored 244 244
Urza's Legacy 143 143 Return to Ravnica 274 274
Urza's Destiny 143 143 Gatecrash 249 249
Mercadian Masques 350 350 Dragon's Maze 156 156
Nemesis 143 143 Theros 249 249
Prophecy 143 144 Born of the Gods 165 165
Invasion 355 356 Journey into Nyx 165 165
Planeshift 146 146 Khans of Tarkir 269 269
Apocalypse 148 148 Fate Reforged 185 185
Odyssey 350 352 Dragons of Tarkir 264 264
Torment 143 143 Oath of the Gatewatch 186 187
Judgment 143 143 Shadows over Innistrad 330 331
Onslaught 350 350 Eldritch Moon 223 223
Legions 145 145 Kaladesh 274 278
Scourge 143 143 Aether Revolt 194 197
Mirrodin 306 306 Amonkhet 287 287
Darksteel 165 165 Hour of Devastation 209 209
Fifth Dawn 165 165 Ixalan 299 299
Champions of Kamigawa 307 307 Rivals of Ixalan 212 212
Betrayers of Kamigawa 165 165 Dominaria 280 280
Saviors of Kamigawa 165 165 War of the Spark 275 311
Ravnica City of Guilds 306 306 Theros Beyond Death 283 356
Guildpact 165 165 Zendikar Rising 368 391
Dissension 180 180 Zendikar 269 269
Coldsnap 155 155 Ikoria Lair of Behemoths 289 384
Time Spiral 301 301 Battle for Zendikar 299 299
Planar Chaos 165 165 Guilds of Ravnica 273 273
Future Sight 180 180 Ravnica Allegiance 273 273

NOTE: All images belong to Magic: The Gathering and Wizards of the Coast respectively

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MTG_Card_Identifier-0.0.2.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

MTG_Card_Identifier-0.0.2-py3-none-any.whl (8.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page