Python: Cooking App P-1
Learning : Python, Data-Base, SQlite
Subject: Writing a Cooking Application
Over view: We will start new project to work on in coming weeks, and will call it ” Cooking App” I will use Python as a code language and Sqlite3 as a database in a full stack task.
Assumptions: I will assume that we have some basic information about Database such as Tables, fields, records and relationships between tables also Primary key and foreign keys. All this are important just to understand what’s going on, and we will write the code to generate all tables through Python code.
The Concept: The Cooking App will give the user the ability to write a food Recipe with it’s ingredients and how to cook it. (Along with it’s photo.. ) The application will have the ability to store a list for ingredient so the user can select from it instead of re-writing it every time, also to save the photo of your dish if you want.
Data-Base Design: In this application we will need four Tables, we will call them: Recipes, Photo, Rec_ingredients and ingredient_list. Each table will have a Primary Key (id).
Here are the Tables and the Fields
- r_id PRIMARY KEY AUTOINCREMENT
- r_name
- r_type (Breakfast, Lunch, Dinner)
- r_tags (NOT Sure to use static list or DB-Table)
- r_date
- r_details
Recipes
-
Photo
- p_id PRIMARY KEY AUTOINCREMENT
- r_id FOREIGN KEY
- p_name
-
Ingredients_List
- ing_id PRIMARY KEY AUTOINCREMENT
- i_name
-
rec_ingredient
- ing_id PRIMARY KEY AUTOINCREMENT
- i_l_id
- r_id
First thing we will write in the application is the Main-Menu and other sub menus we may have in the application. (After posting this article Menus may change)
[ MAIN MENU ]
1. Add New Meal.
2. Ingredients Manager [will have a sub menu]
3. ??.
4. Show Recipes.(Meals) [will have a sub menu]
5. Recipes Information.) [ number or Recipes by date, number on tags, number of Ingredients .. ]
6. Data-Base Information.
7. Setting. [will have a sub menu]
9. Exit.
[ Show Recipes ]
1. Show All Recipes.
2. Show Recipes By Date.
3. Show Recipes By Ingredients.
4. Show Recipes By Tags.
5. Show Recipes By Name.
9. Exit.
[ SETTING MENU ]
1. Create the needed Tables.
2. Drop Tables.
3. Insert Dummy Data. (MUST be run after Tables Creation)
9. Exit.
[ INGREDIENT MENU ]
1. Show all Ingredient.
2. Add Ingredient.
3. Delete Ingredient.
4. Edit Ingredient.
9. Exit.
We can say that this is a blue-print of the application that we want to work on, everything is subject to change while working, since this is a personal application we will be flexible in changing, but in real life project development cycle we need to take an approval (From the Business Owner) on the project plan and design before we start working also to be very clear that : “Any changes in the scope of work may cost money and time”.
Next Post: In next post we will write the codes for the menu also we will create the Tables.
To Download my Python code (.py) files Click-Here
By: Ali Radwani
-
February 6, 2020 at 8:17 amPython: Cooking App P-2 | Ali's Photography Space...