Skip to main content

MTG deck list decoder and encoder library and application

Project description

https://travis-ci.org/pedros/mtgdeck.svg?branch=master https://ci.appveyor.com/api/projects/status/1afabyk0mdbrwsd7?svg=true https://codecov.io/gh/pedros/mtgdeck/branch/master/graph/badge.svg

mtgdeck

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.

Usage

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)

Formats

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.

Installation

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

Contributing

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.

Source Distribution

mtgdeck-0.0.7.tar.gz (5.6 kB view details)

Uploaded Source

File details

Details for the file mtgdeck-0.0.7.tar.gz.

File metadata

  • Download URL: mtgdeck-0.0.7.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for mtgdeck-0.0.7.tar.gz
Algorithm Hash digest
SHA256 dac52617cb784922ce68c6938e10e5c2162d31c113e3cb5d3726f1bdfce9e7a5
MD5 5a8aab3aa9e29e7205285580e2e3f19d
BLAKE2b-256 43b4e638cfd6484ae0c0a2e4748059e393af220cdb0f661f6637cadedaa75329

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page