Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recipe generator #370

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions Ingredient-Based Recipe Generator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Ingredient-Based Recipe Generator

This Python script suggests recipes based on the starting letter of a user's input. It includes over 20 recipes and allows for flexible searching by both ingredient availability and recipe name.

## Features

- **Ingredient-Based Recipe Suggestions**: Enter ingredients, and the script will suggest recipes you can make.
- **Recipe Suggestions by Starting Letter**: Input a letter to get all recipes starting with that letter.
- **Random Recipe Generator**: Get a random recipe for inspiration (coming soon).
- **Category Filter**: Filter recipes by type (e.g., vegetarian, dessert) (coming soon).
- **Favorite Recipes**: Save recipes to favorites for quick access (coming soon).

## Getting Started

### Prerequisites

- **Python 3**: Ensure Python is installed. You can download it [here](https://www.python.org/downloads/).

### Installation

1. Clone this repository or download the script.
2. Open a terminal in the project directory.

### Usage

1. Run the script using the command:
```bash
python recipes.py
49 changes: 49 additions & 0 deletions Ingredient-Based Recipe Generator/recipes.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import random

# Expanded recipe data
recipes = {
"Pasta": ["pasta", "tomato sauce", "cheese", "olive oil", "garlic"],
"Omelette": ["eggs", "milk", "salt", "pepper", "cheese"],
"Salad": ["lettuce", "tomato", "cucumber", "olive oil", "vinegar"],
"Grilled Cheese": ["bread", "butter", "cheese"],
"Smoothie": ["banana", "milk", "honey", "berries"],
"Tacos": ["tortilla", "ground beef", "cheese", "lettuce", "sour cream"],
"Pizza": ["pizza dough", "tomato sauce", "cheese", "pepperoni"],
"Chicken Stir Fry": ["chicken breast", "bell pepper", "soy sauce", "rice", "garlic"],
"Guacamole": ["avocado", "lime", "salt", "tomato", "onion"],
"Pancakes": ["flour", "milk", "egg", "sugar", "baking powder"],
"French Toast": ["bread", "egg", "milk", "cinnamon", "syrup"],
"Baked Salmon": ["salmon", "lemon", "garlic", "olive oil", "salt"],
"Stuffed Peppers": ["bell pepper", "rice", "ground beef", "cheese", "tomato sauce"],
"Fried Rice": ["rice", "egg", "soy sauce", "peas", "carrot"],
"Tomato Soup": ["tomato", "garlic", "onion", "basil", "cream"],
"Mac and Cheese": ["macaroni", "cheese", "milk", "butter", "flour"],
"Garlic Bread": ["bread", "garlic", "butter", "parsley", "cheese"],
"Mashed Potatoes": ["potato", "butter", "milk", "salt", "pepper"],
"Chocolate Cake": ["flour", "cocoa powder", "sugar", "eggs", "butter"],
"Lemonade": ["lemon", "water", "sugar"],
"Fruit Salad": ["apple", "banana", "berries", "orange", "grapes"],
"Chicken Soup": ["chicken", "carrot", "celery", "onion", "broth"],
"Bruschetta": ["bread", "tomato", "basil", "olive oil", "garlic"],
"Beef Stew": ["beef", "potato", "carrot", "celery", "broth"],
"Shrimp Scampi": ["shrimp", "garlic", "butter", "lemon", "pasta"]
}

# Function to suggest recipes based on starting letter
def suggest_recipes_by_letter(start_letter):
suggestions = [recipe for recipe in recipes if recipe.lower().startswith(start_letter.lower())]
return suggestions

# Get the starting letter input from the user
start_letter = input("Enter the starting letter for recipe suggestions: ").strip()

# Get recipe suggestions based on the starting letter
suggested_recipes = suggest_recipes_by_letter(start_letter)

# Output results
if suggested_recipes:
print(f"Recipes that start with '{start_letter}':")
for recipe in suggested_recipes:
print(f"- {recipe}")
else:
print(f"No recipes found starting with '{start_letter}'.")
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ More information on contributing and the general code of conduct for discussion
| QR Code with logo | [QR code with Logo](https://github.com/DhanushNehru/Python-Scripts/tree/master/QR%20with%20Logo) | QR Code Customization Feature |
| Random Color Generator | [Random Color Generator](https://github.com/DhanushNehru/Python-Scripts/tree/master/Random%20Color%20Generator) | A random color generator that will show you the color and values! |
| Remove Background | [Remove Background](https://github.com/DhanushNehru/Python-Scripts/tree/master/Remove%20Background) | Removes the background of images. |
| Recipe Generator | [Remove Background](https://github.com/DhanushNehru/Python-Scripts/tree/Ingredient-Based Recipe Generator/Remove%20Background) | Ingredient-Based Recipe Generator with Smart Suggestions. |

| Rock Paper Scissor 1 | [Rock Paper Scissor 1](https://github.com/DhanushNehru/Python-Scripts/tree/master/Rock%20Paper%20Scissor%201) | A game of Rock Paper Scissors. |
| Rock Paper Scissor 2 | [Rock Paper Scissor 2](https://github.com/DhanushNehru/Python-Scripts/tree/master/Rock%20Paper%20Scissor%202) | A new version game of Rock Paper Scissors. |
| Run Then Notify | [Run Then Notify](https://github.com/DhanushNehru/Python-Scripts/tree/master/Run%20Then%20Notify) | Runs a slow command and emails you when it completes execution. |
Expand Down Expand Up @@ -153,6 +155,8 @@ More information on contributing and the general code of conduct for discussion
| Youtube Downloader | [Youtube Downloader](https://github.com/DhanushNehru/Python-Scripts/tree/master/Youtube%20Downloader) | Downloads any video from [YouTube](https://youtube.com) in video or audio format! |
| Youtube Playlist Info Scraper | [Youtube Playlist Info Scraper](https://github.com/DhanushNehru/Python-Scripts/tree/master/Youtube%20Playlist%20Info%20Scraper) | This python module retrieve information about a YouTube playlist in json format using playlist link. |



## Gitpod

Use the cloud-free development environment where you can directly start coding.
Expand Down