Skip to content

Instantly share code, notes, and snippets.

@encukou
Created October 12, 2012 22:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save encukou/3881966 to your computer and use it in GitHub Desktop.
Save encukou/3881966 to your computer and use it in GitHub Desktop.
$ pokedex pkm
Convert binary Pokémon data (aka PKM files) to/from JSON/YAML.
usage: pokedex pkm (encode|decode) [options] <file> ...
Commands:
encode Convert a JSON or YAML representation of a
Pokémon to the binary format.
decode Convert the binary format to a JSON/YAML
representation.
Options:
--gen=NUM, -g Generation to use (4 or 5)
--crypt, -c Use encrypted binary format.
--yaml, -y Use YAML as the human-readable format.
Requires the pyyaml library to be installed.
Default is to use JSON.
If no files are given, reads from standard input.
$ pokedex pkm decode --crypt --yaml ~/dev/the/data/porygon-encrypted.bin
---
ability: {id: 36, name: Trace}
date met: '2012-06-09'
encounter type: building
exp: 10000
gender: female
met at level: 2
moves:
- {id: 1, name: Pound, pp: 35}
nature: {id: 3, name: Modest}
nickname: Nibbles
original country: us
original trainer: {gender: male, id: 0, name: '', secret: 0}
pokeball: {id: 4, name: "Pok\xE9 Ball"}
species: {id: 137, name: Porygon}
$ pokedex pkm decode --crypt ~/dev/the/data/porygon-encrypted.bin
{"met at level": 2, "pokeball": {"name": "Pok\u00e9 Ball", "id": 4}, "ability": {"name": "Trace", "id": 36}, "nature": {"name": "Modest", "id": 3}, "gender": "female", "original country": "us", "encounter type": "building", "date met": "2012-06-09", "exp": 10000, "moves": [{"pp": 35, "id": 1, "name": "Pound"}], "nickname": "Nibbles", "species": {"name": "Porygon", "id": 137}, "original trainer": {"gender": "male", "secret": 0, "name": "", "id": 0}}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment