Brak opisu

Andrew Swistak 3c77468637 Don't require a POST binding 6 lat temu
Godeps 0b19989260 Update dependencies 6 lat temu
pokemon 6935835a2a Properly handle endianness for pokedex number 7 lat temu
pokemon-parsing 6935835a2a Properly handle endianness for pokedex number 7 lat temu
vendor 0b19989260 Update dependencies 6 lat temu
web 3c77468637 Don't require a POST binding 6 lat temu
Dockerfile 0b19989260 Update dependencies 6 lat temu
README.md da1d4d4b0c Rename README to markdown 7 lat temu
go-pkparse-server.go 642819ebcb Initialize repository; setup barebones server 7 lat temu

README.md

go-pkparse-server

go-pkparse-server is a multi-generational pokemon parser written in Go.

API Usage

POST /parse

Query Params:

Param Required Description
pkmn ✔️ One more pk7 files uploaded in a multipart form

Response:

Param Description
pokedex_number National pokedex number of the pokemon
nickname The UTF-16LE encoded nickname of the pokemon
raw_nickname Base 64 encoded byte string of the pokemon's nickname
raw_pokemon Base 64 encoded byte string of the entire pokemon data

Sample request and response:

curl -X POST http://localhost:8080/parse -F "pkmn=/path/to/thefile.pk7" -F "pkmn=/path/to/anotherfile.pk7" -H "Content-Type: multipart/form-data":

{
   [
      {
         "nickname" : "R\u0000a\u0000t\u0000i\u0000c\u0000a\u0000t\u0000e\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
         "pokedex_number" : 20,
         "raw_nickname" : "UgBhAHQAaQBjAGEAdABlAAAAAAAAAAAA",
         "raw_pokemon" : "ewMXgQAA3QEUAAAAbaoyREAfAAAvBAAAQ1aIAxISAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFIAYQB0AGkAYwBhAHQAZQAAAAAAAAAAAAAApAB1AVMBngAKDxQPAAAAAAAAAAAAAAAAAAA8/P8XUABQAG8AcgBnAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAARgAAAAAAAAAAAAAAAABQAFAAbwByAGcAAAAAAAAAAAAAAAAAAAAAAEYAAAAAAAAAAAARCxIAAADKAAQUACEBAgACAAAAAA=="
      },
      {
         "nickname" : "P\u0000i\u0000k\u0000a\u0000c\u0000h\u0000u\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000",
         "pokedex_number" : 25,
         "raw_nickname" : "UABpAGsAYQBjAGgAdQAAAAAAAAAAAAAA",
         "raw_pokemon" : "wJsMkgAAN4IZAAAA0qVgJQAAAAAJAQAA7DtV5QAJAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAFAAaQBrAGEAYwBoAHUAAAAAAAAAAAAAAAAA8QFVABgB5wAPDw8PAAAAAFUAYgBXAGEAAAAWYq41UABQAG8AcgBnAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAARgAAAAAAAAAAAAAAAABBAHMAaAAAAAAAAAAAAAAAAAAAAAAAAAAAAEYAAAAAAAAAAAARChAAAABBnAQBAB9OAAICAAAAAA=="
      }
   ]
}

Sample error response:

Param Description
error description of the error

Example error: curl -X POST http://localhost:8080/parse -F "pkmn=/path/to/an/invalidfile.pk7" -H "Content-Type: multipart/form-data":

{
  "error": "Invalid length for generation 7 pokemon: 229 bytes"
}