After the disaster that happened in Oak town, Professor Oak decided that enough is enough, and he wants to share whatever data he managed to save from his labs with the public. Fortuantely, he contacted me and asked me to setup an API for people to be able to learn and study more about pokemon to prevent such disasters from ever happening again.
This API is pretty simple and it depends on two mainstream opensource libraries
And another to help with testing our code.
In order to setup this locally follow these steps after cloning the project.
-
setup python environment with:
python -m venv env && source env/bin/activate
-
install requirements with:
pip install -r requirements.txt
-
There are two main scripts.
-
python run_server.py [--port <port_number>] [--debug] [--migrate]
This script will run the server.
--migrate
Flag to run migrations. REQUIRED ON FIRST RUN--port
To run on a different port (default 5000)--debug
For debuffing and hot reloading -
python execute.py import_pokemon --path ./Data/pokemon.csv
This currently only support one command import_pokemon to import pokemon from a csv file into the database.
in order to execute tests, run pytest