Package: pycarde
pycardeA Python package for Nintendo e-Reader cards.How to installYou need python3 installed:https://www.python.org/To install a package, run in your command line:pip install pycardeNOTE: command may vary according to your environment
in case this doesn't work, refer to the official
manuals to runpipon your system.How to useSimplePycarde provides some simple samples for the most common use cases athttps://github.com/irdkwia/pycarde/blob/main/resourcesA list of available constants is defined athttps://github.com/irdkwia/pycarde/blob/main/pycarde/constants.py(note: numerical values must be used in JSON card info files)AdvancedPycarde can also be used to manipulate e-card info as a list of Card objects
containing cards in the same set.
This package provides class types for several card formats detailedhereYou can import theCardclass (from pycarde.card import Card), which provides
useful functions to transform your cards:binaries = Card.makecards(cards, extend=True)returns a list of cards in BIN format as bytes objects from a list of Card objects.extendspecifies if the card list should be extended in case the data need more cards to be fully stored. NOTE: If a card contains too much data, remaining data is inserted at a the beginning of the next one.cards = Card.parsecards(binaries)returns a list of card objects from bytes objects representing cards in BIN format.cards = Card.mergecardsdata(cards)returns the list of cards will all data merged on the first one, which is useful
for multi dotcode apps.IMPORTANT: These functions modify your original card objects and lists!If you need to work with RAW cards instead, you can import transform functions:from pycarde.raw import rawtobin, bintorawThese functions convert a card represented as a bytes object between RAW and BIN format.Note: to convert all cards in a list, you can use list comprehensions such asbinaries = [bintoraw(b) for b in binaries]andbinaries = [rawtobin(b) for b in binaries].e-Reader Card TypesThis will list card types as defined inpycarde.card.
Constants are defined inconstants.py.
Images are all palette indexed, with the first color being transparent.IMPORTANT: Development version! Card properties may change on subsequent releases!All cards have the following properties:region: targeted region (constants)codelen: dotcode length (constants)General CardsRawAppCard - General Purpose Application CardsA general purpose data cards, a.k.a. all cards that are not TCG cards.Properties:data: Data contained in the cardappname: Name of the app for this card set.save:Trueif the e-reader should prompt to save the app on the e-reader flash,Falseif it can't be saved.support: Not relevant.unk1: Not relevant.nes:Trueif the app is a NES ROM.name: Name of the current card in the list of cards to be scanned to run its app.link:Trueif the card contains data that needs to be linked to another app (link cable),Falseif it's a standalone app.TCG CardsAll TCG Cards have these shared fields:pkapp: Type of linked app (constants).special: If the card has its special flag set (unknown purpose).cname: Card name.cid: The TCG card id in "A-99-#" format.hp: HP of the TCG card.STViewCard - TCG Trainer Supporter Viewer CardsDotcodes that contain info for Supporter/Trainer cards.title: A 192x12 4-colors indexed image representing the card title.cdesc: Card description.PkViewCard - TCG Pokémon Viewer CardsDotcodes that contain info for Pokémon cards.cat: Pokémon categorypdest: Pokémon descriptionpname: Pokémon namectype: Pokémon card type (constants)cdesc: Card description.dex: Pokémon dex #height: Height of the Pokémonweight: Weight of the Pokémonsprite: A 40x40 16-colors indexed image representing the Pokémon.evotype: Type of evolution (constants), defining the # of evolutions and pre evo.evos: A list of tuples describing evolutions. The number of entries depend on
theevotype, pre evo is first when defined. Each tuple contain the evolution name
and a 4x4 4-colors indexed image representing the evo.PkSTAppCard - TCG Linked Application CardsApplication dotcodes for TCG cards (minigames and cartoons).Properties:data: Data contained in the cardappname: Name of the app for this card set.save:Trueif the e-reader should prompt to save the app on the e-reader flash,Falseif it can't be saved.support:Trueif the TCG Linked card is a Supporter/Trainer Card.unk1: Not relevant.nes:Trueif the app is a NES ROM.PkAbilityCard - TCG Secret Ability CardsDotcodes that contain info on a secret ability of the scanned Pokémon card.IMPORTANTOnly provides partial support! (This means you should still be able
to modify anything, but unknown fields are reprensented as binary data.)Properties:support:Trueif the TCG Linked card is a Supporter/Trainer Card.abilityflags: A list of 9 integers [0-256[ of unknown data.cdesc: Card description.sprite: A 208x16 16-colors indexed image representing the ability title.fieldspecs: Unknown data that should contain instructions ability usage on TCG battle (the animation that plays when you view it in the e-reader).PkConstructCard - TCG Linked Construction BlocksDotcodes that contain info for a Construction Block.IMPORTANTOnly provides partial support! (This means you should still be able
to modify anything, but unknown fields are reprensented as binary data.)Properties:support:Trueif the TCG Linked card is a Supporter/Trainer Card.layout: A 32x24 16-colors indexed image representing the Construction Block layout in the e-reader Construction menu.layout: Construction Block binary data.blocktype: Block type.unkid: Unknown ID represented as a numerical value, could also be a set of flags.Documentation/Special Thankscaitsith2's ereader research and tools -https://caitsith2.com/ereader/index.htmgbatek's ereader doc -https://problemkaputt.de/gbatek.htm#gbacartereader