

Note that the attributes power, toughness and loyalty are saved as strings since they might contain characters

It is constructed simply with a json response dictionary from either magicthegathering.io or ScryfallĪPI, so PCard has all the attributes matching the responses' keys and values. PCard is a simple persistent dataclass representing Magic: the Gathering cards with their characteristicĪttributes. Modified and saves the according changes automatically when transactions have been committed.Ī good guide on ZODB can for example be found here: PCard Persistence in this case basically means that ZODB will automatically detect when these objects are accessed and Working with the database mostly revolves around working with the following persistent card and card list objects. Usage guide Persistent card, set and card list objects Mtgtools can be simply installed with pip install mtgtools. Good quality card images, so in my opinion it is more useful of the two. Whereas the faces in mtgio are separate cards.Īt the moment, Scryfall has a more extensive database with more useful data like prices and purchase uris and also hosts For example, Scryfall cards contain attribute card_faces Structured in different ways and both have pros and cons. Can be installed with pip install pillowĪt the moment there exists two different kind of APIs for mtg data, Scryfall and magicthegathering.io. PIL - Not necessary, but needed for creating proxy image sheets. Requests - Can be installed with pip install requests. ZODB - Can be installed with pip install zodb. Python 3.5 - mtgtools is tested on Python 3.5 but will probably also work on later versions from any lists of cards.ĭownload card images of the type of your choice from Scryfall.Ĭreate proxy image sheets from lists of cards using Scryfall. Generate random samples, random cards, booster packs etc. Read and write card lists or decks from files. Save your own card lists and decks in a database in pure Python. The usual searching methods on the wholeĬard database of 40k cards take about 0.15s on my computer. Updating the database from scratch usually takes about 2Įasily iterate, filter, sort, group and handle card lists, sets and decks. FeaturesĮasily download, update and save Magic: The Gathering card and set data from Scryfall and/or magicthegathering.io toĪ local ZODB database (native object database for Python). Everything is simply in Python, so no knowledge of SQL or the likes is needed to work with the database. The card dataĬan be easily downloaded from Scryfall API or magicthegathering.io API and saved in a ZODB - database,Ī native object database for Python. Mtgtools is a collection of tools for easy handling of Magic: The Gathering data on your computer.
