Last active
August 29, 2015 14:04
-
-
Save phalt/26d085f6137352527c9c to your computer and use it in GitHub Desktop.
Get Pokemon description based on name using Pykemon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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