/mtgjson4

MTGJSONv4 build scripts for Magic: the Gathering

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

Connect With Us

Discord via Discord

Gitter via Gitter

About Us

MTGJSON is an open sourced database creation and distribution tool for Magic: The Gathering cards, specifically in JSON format.

This repo contains our newest release, version 4. This version relies upon a variety of sources, such as Scryfall and Gatherer for our data.

You can find our documentation with all properties here.

To provide feedback and/or bug reports, please open a ticket as it is the best way for us to communicate with the public.

If you would like to join or assist the development of the project, you can join us on Discord to discuss things further.

How To Use

Note: These are the build directions to compile your own JSON files.
If you are looking for pre-compiled JSON files, you can download them at MTGJSON.com.

This system was built using Python 3.7, so we can only guarantee proper functionality with this version.

  1. First, you'll need to install the MTGJSON4 package and dependencies. You can do this via:
$ pip3 install -r requirements.txt
  1. Select the flags you'd like to run the program with:
Flags Descriptions
-h This prints out the help menu and exits.
-a, --all-sets This tells the program to build all sets. This supersedes the -s flag.
-s SET1 SET2 ... This tells the program to build all set codes passed, provided they exist.
-c, --compiled-outputs This tells the program to compile AllCards and AllSets, following any additional sets being built. This flag needs to be accompanied by either -a, -s, or --skip-rebuild.
--skip-rebuild This tells the program to build no sets, superseding -a and -s, and just use what is cached already. This is the equivalent of passing an empty -s flag. This is only useful with the -c flag.
--skip-cached This flag, in conjunction with -a or -s, tells the program to skips sets that have already been built, and build the remaining sets.
  1. Run the program, with any flags you'd like, via:
usage: mtgjson4 [-h] [-s [SET [SET ...]]] [-a] [-c] [--skip-rebuild] [--skip-cached]
$ python3 -m mtgjson4