-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpokeroguedex.py
More file actions
30 lines (24 loc) · 827 Bytes
/
Copy pathpokeroguedex.py
File metadata and controls
30 lines (24 loc) · 827 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import configparser
import json
import re
import dokuwikixmlrpc
from pokedex.get_species import getSpecies, getPokemonSpecies, getNumFromSpecies
from pokedex.egg_moves import getEggMoves
from pokedex.get_moves import getLevelMoves
config = configparser.ConfigParser()
config.read('config.ini')
baseUrl = (config['CONFIG']['baseFolder'])
pokedexFile = (config['CONFIG']['pokedex'])
# create and load dex
getSpecies()
getPokemonSpecies()
getLevelMoves()
with open(pokedexFile, "r") as pokedex:
pokedexJSON = json.load(pokedex)
# add egg moves
eggMoves = getEggMoves()
for species in eggMoves:
speciesId = getNumFromSpecies(species["name"])
pokedexJSON[speciesId].update({"eggMoves": species["eggMoves"]})
with open(pokedexFile, "w") as pokedex:
json.dump(pokedexJSON, pokedex, indent=4, ensure_ascii=False)