mtgdeck.base package¶
Submodules¶
mtgdeck.base.decoder module¶
Abstract base decoder classes.
-
class
mtgdeck.base.decoder.
Decoder
[source]¶ Bases:
object
Abstract base class for decoders.
Decoders are expected to implement a single method,
_decode()
.
-
class
mtgdeck.base.decoder.
TextDecoder
[source]¶ Bases:
mtgdeck.base.decoder.Decoder
Abstract base class for text-based decoders.
Decoders are expected to set the
deck
property, and override thedecode_entry
method.-
deck
¶ Pyparsing parser that should consume the full input string.
A
OneOrMore
-wrapped pyparsing parser capable of consuming the full input string.
-
-
class
mtgdeck.base.decoder.
XMLDecoder
[source]¶ Bases:
mtgdeck.base.decoder.Decoder
Abstract base class for XML-based decoders.
Decoders are expected to set the
root
,section
andcount
properties.-
count
¶ Quantity (ie: qty, number) tag for the XML decoding format.
-
root
¶ Root (top-level) tag for the XML decoding format.
-
section
¶ Section (ie: sideboard) tag for the XML decoding format.
-
mtgdeck.base.encoder module¶
Abstract base encoder classes.
-
class
mtgdeck.base.encoder.
Encoder
[source]¶ Bases:
object
Abstract base class for encoders.
Encoders are expected to implement a single method,
_encode()
.
-
class
mtgdeck.base.encoder.
TextEncoder
[source]¶ Bases:
mtgdeck.base.encoder.Encoder
Abstract base class for text-based encoders.
Encoders are expected to override the
encode_entry
method.
-
class
mtgdeck.base.encoder.
XMLEncoder
[source]¶ Bases:
mtgdeck.base.encoder.Encoder
Abstract base class for XML-based encoders.
Encoders are expected to set the
root
,section
,section_name
andcount
properties, and theset_content
method.-
count
¶ Quantity (ie: qty, number) tag for the XML encoding format.
-
root
¶ Root (top-level) tag for the XML encoding format.
-
section
¶ Section (ie: sideboard, etc) tag for the XML encoding format.
-
section_name
¶ Section name(ie: sideboard) tag for the XML encoding format.
-
Module contents¶
Abstract base classes.