A REST API serving information about Hogwarts related characters and the four houses.
Run the following command to setup a virtual environment locally:
python3 -m venv .venv
source .venv/bin/activate
py -3 -m venv .venv .venv\scripts\activate
Update the virtual environment:
python -m pip install --upgrade pip
Install dependencies:
python -m pip install -r requirements.txt
-
Create a file named
.env
in the root folder. -
Add following variables in the file:
MYSQL_USER=<user>
MYSQL_PASSWORD=<password>
MYSQL_PORT=<port>
MYSQL_HOST=<host>
Example:
MYSQL_USER=root
MYSQL_PASSWORD=root
MYSQL_PORT=8889
MYSQL_HOST=localhost
You can adjust the environment settings according to your preferences.
python -m flask run
In the console you will find the address where your application is now running. By default, Flask will host the application at http://127.0.0.1:5000.
/houses/<housename>
Returns information about a house. Valid houses are: gryffindor, hufflepuff, ravenclaw, slytherin.
/houses/<housename>/characters
Returns all characters that belong to a given house (gryffindor, hufflepuff, ravenclaw, slytherin).
/houses/heads
Returns information about the houses and their heads.
/houses/total-students
Returns the total number of students that belongs to each house.
/characters/<name>
Returns all characters that matches the name.
/characters/students
Returns all student characters.
/characters/staff
Returns all staff characters.
/characters/others
Returns all other characters.