pycarde


Namepycarde JSON
Version 0.8.7 PyPI version JSON
download
home_pagehttps://github.com/irdkwia/pycarde/
SummaryNintendo e-Reader card-e extractor/maker.
upload_time2024-01-12 02:34:55
maintainer
docs_urlNone
authorirdkwia idkmn
requires_python
licenseGPL
keywords nintendo e-reader card-e
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # pycarde
A Python package for Nintendo e-Reader cards.

## How to install

You need python3 installed: https://www.python.org/

To install a package, run in your command line:
`pip install pycarde`

NOTE: command may vary according to your environment
in case this doesn't work, refer to the official
manuals to run `pip` on your system.

## How to use

### Simple

Pycarde provides some simple samples for the most common use cases at https://github.com/irdkwia/pycarde/blob/main/resources

A list of available constants is defined at https://github.com/irdkwia/pycarde/blob/main/pycarde/constants.py
(note: numerical values must be used in JSON card info files)

### Advanced

Pycarde 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 detailed [here](#e-reader-card-types)

You can import the `Card` class (`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. `extend` specifies 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, bintoraw`

These 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 as `binaries = [bintoraw(b) for b in binaries]` and `binaries = [rawtobin(b) for b in binaries]`.

## e-Reader Card Types

This will list card types as defined in `pycarde.card`.
Constants are defined in [constants.py](https://github.com/irdkwia/pycarde/blob/main/pycarde/constants.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 Cards

#### RawAppCard - General Purpose Application Cards

A general purpose data cards, a.k.a. all cards that are not TCG cards.

Properties:
- `data`: Data contained in the card
- `appname`: Name of the app for this card set.
- `save`: `True` if the e-reader should prompt to save the app on the e-reader flash, `False` if it can't be saved.
- `support`: Not relevant.
- `unk1`: Not relevant.
- `nes`: `True` if 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`: `True` if the card contains data that needs to be linked to another app (link cable), `False` if it's a standalone app.

### TCG Cards

All 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 Cards

Dotcodes 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 Cards

Dotcodes that contain info for Pokémon cards.

- `cat`: Pokémon category
- `pdest`: Pokémon description
- `pname`: Pokémon name
- `ctype`: Pokémon card type (constants)
- `cdesc`: Card description.
- `dex`: Pokémon dex #
- `height`: Height of the Pokémon
- `weight`: Weight of the Pokémon
- `sprite`: 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
the `evotype`, 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 Cards

Application dotcodes for TCG cards (minigames and cartoons).

Properties:
- `data`: Data contained in the card
- `appname`: Name of the app for this card set.
- `save`: `True` if the e-reader should prompt to save the app on the e-reader flash, `False` if it can't be saved.
- `support`: `True` if the TCG Linked card is a Supporter/Trainer Card.
- `unk1`: Not relevant.
- `nes`: `True` if the app is a NES ROM.

#### PkAbilityCard - TCG Secret Ability Cards

Dotcodes that contain info on a secret ability of the scanned Pokémon card.

**IMPORTANT** Only provides partial support! (This means you should still be able
to modify anything, but unknown fields are reprensented as binary data.)

Properties:
- `support`: `True` if 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 Blocks

Dotcodes that contain info for a Construction Block.

**IMPORTANT** Only provides partial support! (This means you should still be able
to modify anything, but unknown fields are reprensented as binary data.)

Properties:
- `support`: `True` if 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 Thanks

- caitsith2's ereader research and tools - https://caitsith2.com/ereader/index.htm
- gbatek's ereader doc - https://problemkaputt.de/gbatek.htm#gbacartereader

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/irdkwia/pycarde/",
    "name": "pycarde",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "Nintendo e-Reader,card-e",
    "author": "irdkwia idkmn",
    "author_email": "irdkwia2000@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/31/ab/c2b36209c934cd5f2b1045c59e4bdf54a9db03fcc0113b6b3adb23ae851e/pycarde-0.8.7.tar.gz",
    "platform": null,
    "description": "# pycarde\r\nA Python package for Nintendo e-Reader cards.\r\n\r\n## How to install\r\n\r\nYou need python3 installed: https://www.python.org/\r\n\r\nTo install a package, run in your command line:\r\n`pip install pycarde`\r\n\r\nNOTE: command may vary according to your environment\r\nin case this doesn't work, refer to the official\r\nmanuals to run `pip` on your system.\r\n\r\n## How to use\r\n\r\n### Simple\r\n\r\nPycarde provides some simple samples for the most common use cases at https://github.com/irdkwia/pycarde/blob/main/resources\r\n\r\nA list of available constants is defined at https://github.com/irdkwia/pycarde/blob/main/pycarde/constants.py\r\n(note: numerical values must be used in JSON card info files)\r\n\r\n### Advanced\r\n\r\nPycarde can also be used to manipulate e-card info as a list of Card objects\r\ncontaining cards in the same set.\r\nThis package provides class types for several card formats detailed [here](#e-reader-card-types)\r\n\r\nYou can import the `Card` class (`from pycarde.card import Card`), which provides\r\nuseful functions to transform your cards: \r\n- `binaries = Card.makecards(cards, extend=True)`\r\nreturns a list of cards in BIN format as bytes objects from a list of Card objects. `extend` specifies 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.\r\n- `cards = Card.parsecards(binaries)`\r\nreturns a list of card objects from bytes objects representing cards in BIN format.\r\n- `cards = Card.mergecardsdata(cards)`\r\nreturns the list of cards will all data merged on the first one, which is useful\r\nfor multi dotcode apps.\r\n\r\n**IMPORTANT**: These functions modify your original card objects and lists!\r\n\r\nIf you need to work with RAW cards instead, you can import transform functions:\r\n`from pycarde.raw import rawtobin, bintoraw`\r\n\r\nThese functions convert a card represented as a bytes object between RAW and BIN format.\r\n\r\nNote: to convert all cards in a list, you can use list comprehensions such as `binaries = [bintoraw(b) for b in binaries]` and `binaries = [rawtobin(b) for b in binaries]`.\r\n\r\n## e-Reader Card Types\r\n\r\nThis will list card types as defined in `pycarde.card`.\r\nConstants are defined in [constants.py](https://github.com/irdkwia/pycarde/blob/main/pycarde/constants.py).\r\nImages are all palette indexed, with the first color being transparent.\r\n\r\n**IMPORTANT**: Development version! Card properties may change on subsequent releases!\r\n\r\nAll cards have the following properties: \r\n- `region`: targeted region (constants)\r\n- `codelen`: dotcode length (constants)\r\n\r\n### General Cards\r\n\r\n#### RawAppCard - General Purpose Application Cards\r\n\r\nA general purpose data cards, a.k.a. all cards that are not TCG cards.\r\n\r\nProperties:\r\n- `data`: Data contained in the card\r\n- `appname`: Name of the app for this card set.\r\n- `save`: `True` if the e-reader should prompt to save the app on the e-reader flash, `False` if it can't be saved.\r\n- `support`: Not relevant.\r\n- `unk1`: Not relevant.\r\n- `nes`: `True` if the app is a NES ROM.\r\n- `name`: Name of the current card in the list of cards to be scanned to run its app.\r\n- `link`: `True` if the card contains data that needs to be linked to another app (link cable), `False` if it's a standalone app.\r\n\r\n### TCG Cards\r\n\r\nAll TCG Cards have these shared fields:\r\n- `pkapp`: Type of linked app (constants).\r\n- `special`: If the card has its special flag set (unknown purpose).\r\n- `cname`: Card name.\r\n- `cid`: The TCG card id in \"A-99-#\" format.\r\n- `hp`: HP of the TCG card.\r\n\r\n#### STViewCard - TCG Trainer Supporter Viewer Cards\r\n\r\nDotcodes that contain info for Supporter/Trainer cards.\r\n\r\n- `title`: A 192x12 4-colors indexed image representing the card title.\r\n- `cdesc`: Card description.\r\n\r\n#### PkViewCard - TCG Pok\u00e9mon Viewer Cards\r\n\r\nDotcodes that contain info for Pok\u00e9mon cards.\r\n\r\n- `cat`: Pok\u00e9mon category\r\n- `pdest`: Pok\u00e9mon description\r\n- `pname`: Pok\u00e9mon name\r\n- `ctype`: Pok\u00e9mon card type (constants)\r\n- `cdesc`: Card description.\r\n- `dex`: Pok\u00e9mon dex #\r\n- `height`: Height of the Pok\u00e9mon\r\n- `weight`: Weight of the Pok\u00e9mon\r\n- `sprite`: A 40x40 16-colors indexed image representing the Pok\u00e9mon.\r\n- `evotype`: Type of evolution (constants), defining the # of evolutions and pre evo.\r\n- `evos`: A list of tuples describing evolutions. The number of entries depend on\r\nthe `evotype`, pre evo is first when defined. Each tuple contain the evolution name\r\nand a 4x4 4-colors indexed image representing the evo.\r\n\r\n\r\n#### PkSTAppCard - TCG Linked Application Cards\r\n\r\nApplication dotcodes for TCG cards (minigames and cartoons).\r\n\r\nProperties:\r\n- `data`: Data contained in the card\r\n- `appname`: Name of the app for this card set.\r\n- `save`: `True` if the e-reader should prompt to save the app on the e-reader flash, `False` if it can't be saved.\r\n- `support`: `True` if the TCG Linked card is a Supporter/Trainer Card.\r\n- `unk1`: Not relevant.\r\n- `nes`: `True` if the app is a NES ROM.\r\n\r\n#### PkAbilityCard - TCG Secret Ability Cards\r\n\r\nDotcodes that contain info on a secret ability of the scanned Pok\u00e9mon card.\r\n\r\n**IMPORTANT** Only provides partial support! (This means you should still be able\r\nto modify anything, but unknown fields are reprensented as binary data.)\r\n\r\nProperties:\r\n- `support`: `True` if the TCG Linked card is a Supporter/Trainer Card.\r\n- `abilityflags`: A list of 9 integers [0-256[ of unknown data.\r\n- `cdesc`: Card description.\r\n- `sprite`: A 208x16 16-colors indexed image representing the ability title.\r\n- `fieldspecs`: Unknown data that should contain instructions ability usage on TCG battle (the animation that plays when you view it in the e-reader).\r\n\r\n#### PkConstructCard - TCG Linked Construction Blocks\r\n\r\nDotcodes that contain info for a Construction Block.\r\n\r\n**IMPORTANT** Only provides partial support! (This means you should still be able\r\nto modify anything, but unknown fields are reprensented as binary data.)\r\n\r\nProperties:\r\n- `support`: `True` if the TCG Linked card is a Supporter/Trainer Card.\r\n- `layout`: A 32x24 16-colors indexed image representing the Construction Block layout in the e-reader Construction menu.\r\n- `layout`: Construction Block binary data.\r\n- `blocktype`: Block type.\r\n- `unkid`: Unknown ID represented as a numerical value, could also be a set of flags.\r\n\r\n## Documentation/Special Thanks\r\n\r\n- caitsith2's ereader research and tools - https://caitsith2.com/ereader/index.htm\r\n- gbatek's ereader doc - https://problemkaputt.de/gbatek.htm#gbacartereader\r\n",
    "bugtrack_url": null,
    "license": "GPL",
    "summary": "Nintendo e-Reader card-e extractor/maker.",
    "version": "0.8.7",
    "project_urls": {
        "Homepage": "https://github.com/irdkwia/pycarde/"
    },
    "split_keywords": [
        "nintendo e-reader",
        "card-e"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6eb8e808d94007a479005f462f3c8443b1046824de0b2cd7676f61e5c139be20",
                "md5": "3498895306e2b3bcfb8d360995622b26",
                "sha256": "b89c426b3cc5f55572805547668369764b9eb9213369fd46913930285bb6e92c"
            },
            "downloads": -1,
            "filename": "pycarde-0.8.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3498895306e2b3bcfb8d360995622b26",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 40663,
            "upload_time": "2024-01-12T02:34:53",
            "upload_time_iso_8601": "2024-01-12T02:34:53.950680Z",
            "url": "https://files.pythonhosted.org/packages/6e/b8/e808d94007a479005f462f3c8443b1046824de0b2cd7676f61e5c139be20/pycarde-0.8.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "31abc2b36209c934cd5f2b1045c59e4bdf54a9db03fcc0113b6b3adb23ae851e",
                "md5": "24340c8cfb5ae408ffce6969110a2e26",
                "sha256": "e0e500265994bb11715392444e2561ebf5bf50a22d8771120e728b345737702b"
            },
            "downloads": -1,
            "filename": "pycarde-0.8.7.tar.gz",
            "has_sig": false,
            "md5_digest": "24340c8cfb5ae408ffce6969110a2e26",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 41084,
            "upload_time": "2024-01-12T02:34:55",
            "upload_time_iso_8601": "2024-01-12T02:34:55.943947Z",
            "url": "https://files.pythonhosted.org/packages/31/ab/c2b36209c934cd5f2b1045c59e4bdf54a9db03fcc0113b6b3adb23ae851e/pycarde-0.8.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-12 02:34:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "irdkwia",
    "github_project": "pycarde",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "pycarde"
}
        
Elapsed time: 0.44616s