I wanted to make different Pokemon projects, so I scraped the data. Here it is, have fun!
pokedex_raw.jsonandpokedex.jsonhave same data- Just that
pokedex_raw.jsonis all in one line - Whilst I've properly formatted
pokedex.json
- First of all,
requestsandjsonalready come withpython, so there is no need forrequirements.txt - I've added
commentsand that cover everything in detail
-
A
requestis sent to Pokemon API followed by pokemon'sid -
Then convert the response to
json -
poke{}dictionary/map holds data for current pokemonidnameheightweightxpimage_urlPokeres
-
abilities[],stats[]andtypes[]hold data of abilities, stats and types of current pokemon and then, assigned to current pokemonpoke['abilities'] = abilitiespoke['stats'] = statspoke['types'] = types
-
Then, the current
poke{}is assigned topokemons{}with the key of pokemon's namepokemons[poke['name']] = poke
-
Finally,
pokemons{}is converted tojsonand stored in a.jsonfile