I wanted to make different Pokemon projects, so I scraped the data. Here it is, have fun!
pokedex_raw.json
andpokedex.json
have same data- Just that
pokedex_raw.json
is all in one line - Whilst I've properly formatted
pokedex.json
- First of all,
requests
andjson
already come withpython
, so there is no need forrequirements.txt
- I've added
comments
and that cover everything in detail
-
A
request
is sent to Pokemon API followed by pokemon'sid
-
Then convert the response to
json
-
poke{}
dictionary/map holds data for current pokemonid
name
height
weight
xp
image_url
Pokeres
-
abilities[]
,stats[]
andtypes[]
hold data of abilities, stats and types of current pokemon and then, assigned to current pokemonpoke['abilities'] = abilities
poke['stats'] = stats
poke['types'] = types
-
Then, the current
poke{}
is assigned topokemons{}
with the key of pokemon's namepokemons[poke['name']] = poke
-
Finally,
pokemons{}
is converted tojson
and stored in a.json
file