DiddiZ / mtg-proxies

Print high-resolution MtG proxies.
MIT License
51 stars 14 forks source link
archidekt decklist magic-the-gathering manastack mtg mtg-cards pdf proxies scryfall

Tests

MtG-Proxies

Create a high quality printable PDF from your decklist or a list of cards you want to proxy.

Features

Usage

  1. Clone or download this repo.
git clone https://github.com/DiddiZ/mtg-proxies.git
cd mtg-proxies
  1. Install requirements. Requires at least Python 3.9.
# On Linux, use `python3` instead of `python`
python -m pip install -e .

You can also use a virtual environment.

  1. (Optional) Prepare your decklist in MtG Arena format. This is not required, but recommended as it allows for more control over the process.
COUNT FULL_NAME (SET) COLLECTOR_NUMBER

E.g.:

1 Alela, Artful Provocateur (ELD) 324
1 Korvold, Fae-Cursed King (ELD) 329
1 Liliana, Dreadhorde General (WAR) 97
1 Murderous Rider // Swift End (ELD) 287

Or use the convert.py tool to convert a plain decklist to Arena format:

python convert.py examples/decklist_text.txt examples/decklist.txt
  1. Create a PDF file.
python print.py examples/decklist.txt decklist.pdf

Examples:

python print.py examples/decklist.txt decklist_fronts.pdf --face front
python print.py examples/decklist.txt decklist_backs.pdf --face back

Updating

git pull --ff-only
python -m pip install -e .

Help

print

pipenv run python print.py [-h] [--dpi DPI] decklist outfile

Prepare a decklist for printing.

positional arguments:
  decklist_spec         path to a decklist in text/arena format, or manastack:{manastack_id}, or archidekt:{archidekt_id}
  outfile               output file. Supports pdf, png and jpg.

optional arguments:
  -h, --help            show this help message and exit
  --dpi DPI             dpi of output file (default: 300)
  --paper WIDTHxHEIGHT  paper size in inches or preconfigured format (default: a4)
  --scale FLOAT         scaling factor for printed cards (default: 1.0)
  --border_crop PIXELS  how much to crop inner borders of printed cards (default: 14)
  --background COLOR    background color, either by name or by hex code (e.g. black or "#ff0000", default: None)
  --cropmarks, --no-cropmarks
                        add crop marks (default: True)
  --faces {all,front,back}
                        which faces to print (default: all)

convert

usage: pipenv run python convert.py decklist outfile [OPTIONAL ARGUMENTS]

Convert a decklist from text format to arena format or vice-versa.

positional arguments:
  decklist_spec         path to a decklist in text/arena format, or manastack:{manastack_id}, or archidekt:{archidekt_id}
  outfile               output file

optional arguments:
  -h, --help            show this help message and exit
  --format {arena,text}
                        output format (default: arena)
  --clean               remove all non-card lines

tokens

usage: pipenv run python tokens.py decklist [OPTIONAL ARGUMENTS]

Append the tokens created by the cards in a decklist to it.

positional arguments:
  decklist_spec         path to a decklist in text/arena format, or manastack:{manastack_id}, or archidekt:{archidekt_id}

optional arguments:
  -h, --help            show this help message and exit
  --format {arena,text}
                        output format (default: arena)

Example:

python tokens.py examples/token_generators.txt

Deck Value Decomposition

usage: deck_value.py decklist [OPTIONAL ARGUMENTS]

Show deck value decomposition.

positional arguments:
  decklist_spec         path to a decklist in text/arena format, or manastack:{manastack_id}, or archidekt:{archidekt_id}

optional arguments:
  -h, --help            show this help message and exit
  --lump-threshold FLOAT
                        lump together cards with lesser proportional value

Example:

pipenv run python deck_value.py manastack:1234536
pipenv run python deck_value.py archidekt:365563

Acknowledgements