webmaster-kazu.com

テクノロジー・データ分析・実践ログ・その他

MTG(マジック:ザ・ギャザリング)APIのPythonラッパー「mtgsdk」のインストール

カテゴリ: Python(遊び)

MTG(マジック:ザ・ギャザリング)APIのPythonラッパー「mtgsdk」のインストールについて解説しています。

「mtgsdk(https://github.com/MagicTheGathering/mtg-sdk-python)」は、マジック:ザ・ギャザリングの開発者向けリソース(https://magicthegathering.io/)のMTG APIのラッパーです。

■Python

今回のPythonのバージョンは、「3.8.5」を使用しています。(Windows10)(pythonランチャーでの確認)

なお、この「mtgsdk」パッケージはPython 3.4 で開発されていますが、今回は「3.8.5」にインストールを試みます。

■mtgsdkをインストールする

mtgsdkをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。

pip install mtgsdk

起動後、上記のコマンドを入力し、Enterキーを押します。

なお、今回は、pythonランチャーを使用しており、Python Version 3.8.5にインストールを行うために、pipを使う場合にはコマンドでの切り替えを行います。

py -3.8 -m pip install mtgsdk

切り替えるために、上記のコマンドを入力し、Enterキーを押します。

Defaulting to user installation because normal site-packages is not writeable

Collecting mtgsdk

Downloading mtgsdk-1.3.1.tar.gz (6.1 kB)

Preparing metadata (setup.py) ... done

Building wheels for collected packages: mtgsdk

Building wheel for mtgsdk (setup.py) ... done

Created wheel for mtgsdk: filename=mtgsdk-1.3.1-py3-none-any.whl size=13918 sha256=c27eaeffe23e9f8621ec51fb6d5fafd2608b4c17e7bb87245239e3aab9cc63b9

Stored in directory: c:\users\user_\appdata\local\pip\cache\wheels\ea\fb\97\3e88a1120515cccae937bb7b44064c8a8fad21f1a99a2a490b

Successfully built mtgsdk

Installing collected packages: mtgsdk

Successfully installed mtgsdk-1.3.1

Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、mtgsdkが正常にインストールされたことになります。

なお、今回はmtgsdkのバージョン1.3.1をインストールしました。