Repository for CS361 - Software Engineering 1 at OSU
Microservice Portion - Must have the PokePicker running on your local machine
** This microservice utilizes this json file: https://github.com/Purukitto/pokemon-data.json and it must be saved on your local PC
Step 1. Make sure you're in the same directory as the pokepicker file and the pokemon-data.json
Step 2. Run pokepicker.py - the get_pokemon_micro is the specific function for the microservice
Step 3. Be sure to enter the correct path for the text file
Example Call:
def run_microservice():
"""runs the microservice"""
while True:
with open("microservice.txt", "r+") as file:
line = file.readline()
if line == "request":
pokemon = get_pokemon_micro() # calls the microservice
outfile = open("microservice.txt", 'w')
poke_name = pokemon.strip('"')
outfile.write(poke_name)
outfile.close()
run_microservice()
Step 1. After request is written in the microservice.txt file, the function above will overwrite it with a random pokemon name
Step 2. The pokemon name will be returned and available to be used at will.