Skip to content

Instantly share code, notes, and snippets.

@phalt
Last active August 29, 2015 14:04
Show Gist options
  • Save phalt/26d085f6137352527c9c to your computer and use it in GitHub Desktop.
Save phalt/26d085f6137352527c9c to your computer and use it in GitHub Desktop.
Get Pokemon description based on name using Pykemon
import pykemon
name = 'charizard' # Example
p = pykemon.get(pokemon=name)
# Figure out the number of descriptions we have for this Pokemon
des = p.descriptions
l = str(len(des))
uri = des[name + '_gen_' + l]
# SOME MANPIULATION OF STRING NEEDS TO BE DONE
id = uri.split('/')[4]
d = pykemon.get(description_id=id)
# Description is here
d.description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment