mtgatracker / python-mtga

MTGA set data & tooling for python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python MTGA

MTGA tools & set data for python. Original cardset generated with MTGJSON and scryfall, with initial set of MTGA grpId's collected by Fugi & Spencatro. (Now we just use the data already present in your MTGA installation.)

Installation

pip install mtga or python setup.py install

Usage

from mtga.set_data import all_mtga_cards
print(all_mtga_cards.find_one("Mangara"))
# <Card: 'Mangara, the Diplomat' ['White'] M21 71809>
print(all_mtga_cards.find_one(71809))
# <Card: 'Mangara, the Diplomat' ['White'] M21 71809>
print(all_mtga_cards.find_one("71809"))
# <Card: 'Mangara, the Diplomat' ['White'] M21 71809>

Deploying

Because I always forget:

python setup.py sdist bdist_wheel
twine check dist/*  # check for readme issues (e.g. line endings MUST BE LF, not CRLF lol)
twine upload dist/MTGA-<version>*

About

MTGA set data & tooling for python

License:MIT License


Languages

Language:Python 100.0%