Reci-Python is a command-line program developed in Python that allows users to conveniently search for recipes based on their names or ingredients. The program provides a simple and efficient way to explore a wide variety of recipes and discover new culinary ideas.
This is an ideal program for individuals who have a passion for cooking, enjoy experimenting with different recipes, and want a convenient way to access a vast collection of culinary ideas. It is particularly suitable for the following groups of people Home Cooks and Food Enthusiasts, Health-Conscious Individuals, Culinary Students and Chefs and Busy Professionals and Students.
Live version Here
- This section will allow the user to select the way to get a recipe or to exit the program.
- When in the main menu option 2 was selected an ingredient will be added and then the secondary menu would be displayed to allow the user to select another ingredient, get the recipe, or start again.
- This section displays the list of recipe/s prepared and the user could choose between them or go back to the main menu
- This section displays the recipe with title, description, and instructions.
All inputs in this program are validated and would display an error message if there was a format issue. In menus, there is always an option to go back and even exit the program.
Feature | Expect | Action | Result | Pass/Fail |
---|---|---|---|---|
Main menu | When selecting any CORRECT option will proceed to the action | selected 1, 2, 0 in different tries | action perfectly executed | ✔️ |
Main menu | When selecting an INCORRECT option or text format will proceed to display a message validator | typed 4, and in another try "cheese" | a validation message was displayed | ✔️ |
Add Recipe by name input | When typing and entering any string will start preparing the recipe | typed a string | action perfectly executed | ✔️ |
Add Recipe by name input | When typing and entering any string mixed with numbers or just numbers will display a validator message | typed a string mixed with a number and then a number | validator message displayed | ✔️ |
Add Recipe by ingredient input | When typing and entering any string will display the secondary menu | typed a string | secondary menu displayed | ✔️ |
Add Recipe by ingredient input | When typing and entering any string mixed with numbers or just numbers will display a validator message | typed a string mixed with number | validator message displayed | ✔️ |
Secondary menu | When selecting any CORRECT option will proceed to the action | selected 1, 2, 3 in different tries | action perfectly executed | ✔️ |
Secondary menu | When selecting an INCORRECT option or text format will proceed to display a message validator | typed 4, and in another try "chicken" | a validation message was displayed | ✔️ |
Recipes list menu | When selecting any CORRECT option will proceed to display the recipe | selected 1, 2, 3, 4, and 5 in different tries | action displays the recipe | ✔️ |
Recipes list menu | When selecting an INCORRECT option or text format will proceed to display a message validator | typed 8, and in another try "ham" | a validation message was displayed | ✔️ |
Recipes list menu | When selecting option 0 will go back to the main menu | typed 0 and enter | main menu was displayed | ✔️ |
Main menu | When selecting option 0 will exit the program | typed 0 and enter | Program was shut off | ✔️ |
Also, the program was tested using the NodeJS template in a local environment before uploading to Heroku.
- In adding "recipe by the name" and "recipe by ingredient" inputs any type of string is valid like "chicken" or also "akjdalskdj", this would let you continue, but it would just return a wrong recipe message at a later stage like the following image.
The Program was deployed in Heroku.
-
Log in to your Heroku account and access the dashboard.
-
Look for the "New" button and click on it to create a new app.
-
Provide a unique name for your app, select the region that is closest to you, and click "Create app."
-
In the app's settings, locate the "Reveal Config Vars" button and click on it.
-
Create a configuration variable "API_URL" and the value "https://tasty.p.rapidapi.com/recipes/list"
-
Get your API key and create a configuration variable "API_KEY" and complete the value with your key.
-
Create another configuration variable "PORT" and the value to "8000," and click "Add."
-
To specify the dependencies for your app, go to the "Add Buildpack" section.
-
Select "Python" as the first dependency and "Node.js" as the second. The order of the dependencies is crucial.
-
Navigate to the "Deploy" tab and choose "GitHub" as the deployment method.
-
Connect your Heroku account to your GitHub account and select the repository you want to deploy.
-
Enable the "Automatic Deploy" option if you want Heroku to rebuild your project automatically every time you push a new commit.
-
Copy the GitHub repository
-
Open your terminal
-
Change the current working directory to the location where you want the cloned directory.
-
Write 'git clone "GitHub repository"'
-
Navigate to the folder and add a .env file
-
Add env configurations API_URL and API_KEY (see deployment section)
-
Run the program with the command: "python3 run.py"
-
I developed the program using Python, and the template uses HTML, CSS, and Javascript
-
RapidAPI - Tasty - Tasty API from RapidApi was used to get recipes
-
GitHub and Git were used to document the development process
-
Heroku was used for deployment.
-
PEP8CI was used to validate Python code.
-
StackEdit to write README
-
Lucidchart was used to make the flowchart.
-
ASCII Art Generator - to create logo and art messages
-
Badgnen - for readme badges
- Command Line Interface Guidelines clig.dev
- Code snippet for request API RapidApi
- Exception handling for Python requests StackOverflow
- Exception handling for Python requests geeksforgeeks
- Working with credentials and configs in Python tutorial
- The Best way to navigate a nested JSON in Python StackOverflow
- How to check if a variable is a string tutorial
- Check if a string contains only letters tutorial
- Using textwrap module docs.python
- To get invalid emoji StackOverflow
- Progress bar module GitHub - tqdm
- How to print simulate typing StackOverflow