Skip to main content

CLI tool for converting MTG collection CSV files between formats

Project description

Transmute

PyPI version Python 3.12+ License: MIT

CLI tool for converting Magic: The Gathering collection CSV files between formats.

Features

  • Convert collections between 16 different formats
  • Auto-detect input format from CSV headers
  • Optional Scryfall API integration to fill missing card data
  • Simple command-line interface

Installation

pip install transmute-mtg

Or with uv:

uv tool install transmute-mtg

Usage

Convert between formats

# Basic conversion (auto-detect input format)
transmute convert my-collection.csv output.csv -o manabox

# Specify both input and output formats
transmute convert goldfish-export.csv moxfield-import.csv -i mtggoldfish -o moxfield

# Fill missing card data via Scryfall API
transmute convert collection.csv output.csv -o helvault --scryfall

List supported formats

transmute formats

Auto-detect a file's format

transmute detect mystery-file.csv

Supported Formats

Format CLI Name Notes
Archidekt archidekt Flexible columns, Scryfall ID support
Card Kingdom cardkingdom Simple 4-column format for selling
Cardsphere cardsphere Trading platform with Scryfall ID
Deckbox deckbox Uses full set names
Decked Builder deckbuilder Separate regular/foil quantities
Deckstats deckstats 0/1 for foil status
DragonShield dragonshield Card scanner app with folder support
Helvault helvault Requires Scryfall IDs
ManaBox manabox Popular mobile app
Moxfield moxfield Popular deck builder
MTGGoldfish mtggoldfish Supports FOIL/REGULAR/FOIL_ETCHED
MTG Manager mtgmanager Numeric codes for condition
MTGO mtgo Magic Online format
MTGStocks mtgstocks Price tracking site
MTG Studio mtgstudio Simple Yes/No foil format
TCGPlayer tcgplayer Includes Product ID/SKU

Python API

You can also use transmute as a library:

from pathlib import Path
from transmute.converter import Converter
from transmute.formats import FormatRegistry

# Convert a file
converter = Converter(use_scryfall=True)
converter.convert(
    input_path=Path("collection.csv"),
    output_path=Path("output.csv"),
    input_format="mtggoldfish",
    output_format="manabox",
)

# Read a collection
handler = FormatRegistry.get("helvault")
collection = handler.read(Path("helvault-export.csv"))

for entry in collection:
    print(f"{entry.quantity}x {entry.card.name} ({entry.card.set_code})")

CSV Format Examples

Helvault
collector_number,extras,language,name,oracle_id,quantity,scryfall_id,set_code,set_name
"136","foil","en","Goblin Arsonist","c1177f22-...","4","c24751fd-...","m12","Magic 2012"
MTGGoldfish
Card,Set ID,Set Name,Quantity,Foil,Variation
Aether Vial,MMA,Modern Masters,1,REGULAR,""
Anax and Cymede,THS,Theros,4,FOIL,""

Foil values: FOIL, REGULAR, FOIL_ETCHED

ManaBox
Name,Set code,Set name,Collector number,Foil,Rarity,Quantity,Scryfall ID,Condition,Language
Lightning Bolt,m10,Magic 2010,146,foil,Common,4,abc123...,NM,en
Moxfield
Count,Tradelist Count,Name,Edition,Condition,Language,Foil,Alter,Proxy,Purchase Price
4,2,Lightning Bolt,m10,NM,English,foil,,,
DragonShield
Folder Name,Quantity,Trade Quantity,Card Name,Set Code,Set Name,Card Number,Condition,Printing,Language
Binder,4,0,Lightning Bolt,M10,Magic 2010,146,NearMint,Foil,English
TCGPlayer
Quantity,Name,Simple Name,Set,Card Number,Set Code,Printing,Condition,Language,Rarity,Product ID,SKU
1,Verdant Catacombs,Verdant Catacombs,Zendikar,229,ZEN,Normal,Near Mint,English,Rare,33470,315319
Deckbox
Count,Tradelist Count,Name,Edition,Card Number,Condition,Language,Foil,Signed
4,4,Angel of Serenity,Return to Ravnica,1,Near Mint,English,,,

Edition is the full set name (not code). Foil is foil or empty.

MTGO
Card Name,Quantity,ID #,Rarity,Set,Collector #,Premium
Banisher Priest,1,51909,Uncommon,PRM,1136/1158,Yes

Premium is Yes for foils, No otherwise.

MTGStocks
"Card","Set","Quantity","Price","Condition","Language","Foil","Signed"
"Advent of the Wurm","Modern Masters 2017",1,0.99,M,en,Yes,No
Deckstats
amount,card_name,is_foil,is_pinned,set_id,set_code
1,"Abandon Reason",0,0,147,"EMN"
MTG Manager
Quantity,Name,Code,PurchasePrice,Foil,Condition,Language,PurchaseDate
1,"Amulet of Vigor",WWK,18.04,0,0,0,5/6/2018

Condition and Language use numeric codes.

Development

# Clone and install
git clone https://github.com/oflannabhra/transmute.git
cd transmute
uv sync

# Run tests
uv run pytest

# Lint
uv run ruff check src/ tests/

# Format
uv run ruff format src/ tests/

License

MIT License - see LICENSE for details.

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

transmute_mtg-0.1.0.tar.gz (51.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

transmute_mtg-0.1.0-py3-none-any.whl (34.0 kB view details)

Uploaded Python 3

File details

Details for the file transmute_mtg-0.1.0.tar.gz.

File metadata

  • Download URL: transmute_mtg-0.1.0.tar.gz
  • Upload date:
  • Size: 51.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for transmute_mtg-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ff128b2966d2b1cfae2d4bfaf0aaf314a52cb8e9838037b0f01dcef458dcacb4
MD5 6e5af28709196362117dca2c90d3ecbb
BLAKE2b-256 4f6cd1cf851747fdd39ec6bd81b95542f1cb29c8cb7901e0cb306daeaffd7809

See more details on using hashes here.

File details

Details for the file transmute_mtg-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for transmute_mtg-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c66085e5be82b52a5c0333c2b5145c5c8e4d450f9a70015c1f0ec1777c225a8f
MD5 62570ca4a8a8b2c9034beedd7241ea82
BLAKE2b-256 b7e99266a4a3962ceb8d0319ae526dce17ad3a3c170d4cf952a93c4ae160b988

See more details on using hashes here.

Supported by

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