Skip to content

tazzuu/mtgconv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mtgconv

Magic the Gathering Deck list converter.

mtgconv is a CLI tool & Go library to convert deck lists between different input sources and output formats.

Features

  • Fetch a deck list from supported online platforms
  • Convert a deck list into multiple output formats
  • Search for decks on supported online platforms and batch-convert the results
  • Core package built in Go, designed for re-use as a library, and designed with a modular system for adding new input sources and output formats

Supported Input Sources

Supported Outputs Formats

  • .dck decklist format
    • includes "Compatibility Mode" support to output reduce card information to ensure support for various programs
  • .txt plain text format
  • .json serialized format

Usage

See all the cli flags and options available;

mtgconv --help
mtgconv convert --help
mtgconv search --help

Examples

Convert an Archidekt deck to .dck format

mtgconv convert --input-source archidekt-url --output-format dck --compatibility-mode https://archidekt.com/decks/7031486/buffs_by_hans

Convert a Moxfield deck to .txt decklist format

mtgconv --user-agent "$MOXKEY" convert --output-format txt https://moxfield.com/decks/AZKbE6E6kUWW2zMfHR41sQ

Convert an Archidekt deck to .dck decklist format

mtgconv --output-dir archidekt-decks --compatibility-mode convert --output-filename auto --output-format dck --input-source archidekt-url https://archidekt.com/decks/13186988

Search for the top 100 Commander decks and save them as .dck deck list files

# Moxfield search
mtgconv --user-agent "$MOXKEY" search moxfield.com

# Moxfield Commander PreCon deck search
mtgconv --user-agent "$MOXKEY" search --output-dir precon-decks --compatibility-mode --page-end 10 --deck-format commanderPrecons moxfield.com

# Archidekt search
./mtgconv --output-dir archidekt-decks --compatibility-mode search --sort-type views --page-end 5 archidekt.com

Convert a Shiny .csv collection file into txt format

./mtgconv convert --input-source shiny-csv --output-format txt  ShinyExport-1234567890.csv

Convert a Shiny .csv collection into a Moxfield Collection .csv

mtgconv convert --output-format moxfield-collection --input-source shiny-csv --compatibility-mode ShinyExport-1234567890.csv
  • NOTE: querying Moxfield requires an API key

Installation

Download

Download a pre-compiled version for your system from the Releases page.

Build Locally

Building locally requires Go version 1.24.5+ to be installed

Build with the included Makefile recipe:

make build

Project Layout

  • cmd/mtgconv: cli entrypoint
  • pkg/mtgconv2/core: core pipeline, configs, and types
  • pkg/mtgconv2/sources: input source adapters
  • pkg/mtgconv2/outputs: output handlers

Planned Features

  • web interface & hosted app instance
  • static resource repository of retrieved & converted deck lists
  • add more input sources

Examples

Some examples of deck lists exported with mtgconv can be found here

About

Magic the Gathering deck list converter

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors