MTG API is an API for Magic the Gathering card data built with Python. It provides access to a collection of Magic the Gathering cards through a RESTful interface.
To set up MTG API, follow these steps:
-
Python 3: Make sure you have Python 3 installed on your system. You can download it from here.
-
mtgsdk Python Package: Install the
mtgsdkPython package using pip:pip install mtgsdk
-
MongoDB: Make sure you have MongoDB installed on your system. You can download it from here.
-
MongoDB Collection: Create a MongoDB database and a collection called
cardswhere the card data will be stored.
To get started with MTG API, follow these steps:
- Import Card Data: Import card data from the official API to the database by running
src/importer.py. Make sure to update the database connection details in the importer script before running it.
python src/importer.pyTests are automatically run on Github when a PR is created or updated.
To run them manually:
pipenv run pytest