Skip to content

maycuch/Build_API_Python_MySQL_July_2024

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build own API: Python_MySQL project

What does this project do

  • it is a recipe API built in Python using data from MySQL and user's input
  • it extracts recipes from MySQL database into URL, where you can filter recipes by cuisine type
  • it asks user if they would like to add a new recipe into database and if so it adds it into URL and MySQL database

How to use it

  • programmes you need to run this applicaton:
    • Python software,
    • editor to run the code, eg. PyCharm,
    • interpreter for the MYSQL language MySQL Community Server,
    • application to see database data. e.g. MySQL WorkBench
    • in order to work with MySQL database you need to add your credentials into config.py file

Instructions

  • open Pycharm and run app.py; the URL is located in result window (http://127.0.0.1:5000);

  • click on url which takes you to the homepage;

  • add an endpoint 'recipes' to the url and you will be able to see all recipes from MySQL database project_4, table recipes (there are 4 recipes);

  • you can filter recipes by cuisine type by using endpoint .../recipes/<cuisine type> (options based on recipes in MySQL database are american, middle eastern, central europe)

  • go back to Pycharm and in terminal navigate into the folder assignment-4-build-API and type 'python main.py', you will be greeted with welcome message and a list of all recipes in the database main py screenshot

  • when asked if you want to add a recipe type 'y' and answer questions regarding a new recipe you want to add Screenshot main py user input

  • at this point a new recipe has been added to the URL and MySQL database;

  • MySQL result: Screenshot MySQL table with added recipe from user

  • URL result: URL with newly added recipe

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages