Skip to main content

MTG deck list decoder and encoder library and application

Project description

Linux builds passing Windows builds passing Coverage Grade Maintainability PyPI version

MTG decklist decoder and encoder library and application

What is it?

mtgdeck is an application and library for decoding and encoding various decklist formats for Magic: The Gathering.


Automatically determine input format in standard input and encode using default encoder (text) to standard output:

mtgdeck < input.mws > output.txt

The same as above, but from Python:

import sys
import mtgdeck
mtgdeck.dump(mtgdeck.load(sys.stdin), sys.stdout)

Decode a Cockatrice decklist and encode to OCTGN, specifying files:

mtgdeck -d cod -e octgn -i input.cod -o output.o8d

And in Python:

import mtgdeck
src = open('input.cod')
target = open('output.o8d', 'w')
decklist = mtgdeck.load(src, cls=mtgdeck.CockatriceDecoder)
mtgdeck.dump(decklist, target, cls=mtgdeck.OCTGNEncoder)


mtgdeck currently supports the following formats:

Magic online:text (.txt and .dec)
Magic Workstation:mws (.mwDeck)
OCTGN:o8d (.o8d)
Cockatrice:cod (.cod)

The default decoder is auto: it tries to infer the correct decklist format. The default encoder is text.


pip install mtgdeck
mtgdeck --help  # or python -m mtgdeck --help


See the Contribution guidelines file.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Built Distribution

mtgdeck-0.2.0-py3-none-any.whl (11.6 kB view hashes)

Uploaded 3 6

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page