Skip to main content

Magic: the Gathering decklist parser

Project description

mtg-parser

How to install

pip install mtg-parser

Quick Start

mtg_parser.parse_deck() can parse any decklist (textual or online) but if for any reason you want the specialized version, here are the supported websites:

  • aetherhub.com
  • archidekt.com
  • deckstats.net
  • moxfield.com
  • mtggoldfish.com
  • tappedout.net
  • tcgplayer.com

From textual decklist

mtg_parser can parse textual decklists with either MTGO or MTGA format

import mtg_parser

decklist = """
	1 Atraxa, Praetors' Voice
	1 Imperial Seal
	1 Lim-Dûl's Vault
	1 Jeweled Lotus (CMR) 319
	1 Llanowar Elves (M12) 182
	3 Brainstorm #Card Advantage #Draw
"""

cards = mtg_parser.decklist.parse_deck(decklist)

for card in cards:
	print(card)

From aetherhub.com

mtg_parser can parse public decks from aetherhub.com

import mtg_parser

url = 'https://aetherhub.com/Deck/<deckname>'
cards = mtg_parser.aetherhub.parse_deck(url)
for card in cards:
	print(card)

From archidekt.com

mtg_parser can parse public decks from archidekt.com

import mtg_parser

url = 'https://www.archidekt.com/decks/<deckid>/'
cards = mtg_parser.archidekt.parse_deck(url)
for card in cards:
	print(card)

From deckstats.net

mtg_parser can parse public decks from deckstats.net

import mtg_parser

url = 'https://deckstats.net/decks/<userid>/<deckid>'
cards = mtg_parser.deckstats.parse_deck(url)
for card in cards:
	print(card)

From moxfield.com

mtg_parser can parse public decks from moxfield.com

import mtg_parser

url = 'https://www.moxfield.com/decks/<deckid>'
cards = mtg_parser.moxfield.parse_deck(url)
for card in cards:
	print(card)

From mtggoldfish.com

mtg_parser can parse public decks from mtggoldfish.com

import mtg_parser

url = 'https://www.mtggoldfish.com/deck/<deckid>'
cards = mtg_parser.mtggoldfish.parse_deck(url)
for card in cards:
	print(card)

From tappedout.net

mtg_parser can parse public decks from tappedout.net

import mtg_parser

url = 'https://tappedout.net/mtg-decks/<deckid>/'
cards = mtg_parser.tappedout.parse_deck(url)
for card in cards:
	print(card)

From tcgplayer.com

mtg_parser can parse public decks from tcgplayer.com

import mtg_parser

url = 'https://decks.tcgplayer.com/magic/<deckpath>'
cards = mtg_parser.tcgplayer.parse_deck(url)
for card in cards:
	print(card)

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

mtg_parser-0.0.1a17.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

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

mtg_parser-0.0.1a17-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file mtg_parser-0.0.1a17.tar.gz.

File metadata

  • Download URL: mtg_parser-0.0.1a17.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.1 Darwin/21.4.0

File hashes

Hashes for mtg_parser-0.0.1a17.tar.gz
Algorithm Hash digest
SHA256 c45e5714116be46774fd6be795a72947308f27d901d1f41db9329f2c6320f6c7
MD5 9bb4554e8986cf88f1f296c15f609b26
BLAKE2b-256 1f844428e9e4f8618971ec1af13edcd946e84d94c6b69af82cf27bc28c2b8204

See more details on using hashes here.

File details

Details for the file mtg_parser-0.0.1a17-py3-none-any.whl.

File metadata

  • Download URL: mtg_parser-0.0.1a17-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.13 CPython/3.9.1 Darwin/21.4.0

File hashes

Hashes for mtg_parser-0.0.1a17-py3-none-any.whl
Algorithm Hash digest
SHA256 450056df15702d36e281ff7cf0d24dfe7bc8241b31de25d695690af67a1dcdf4
MD5 80370bcc4e3f521884a2ac06ad345436
BLAKE2b-256 c449c52b30869b62d751f613a75e39a4d492ea014848381e292d133ac88f6296

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