Package: quickbite
QuickBite: Recipe GeneratorModern Data Structures - Fall 2023Columbia University QMSSHafsah T. ShaikAboutQuickBite is a Python-based command-line application that generates cooking recipes based on user-inputted ingredients. It aims to promote cooking with available resources, reduce food waste, and simplify meal planning by utilizing data from various recipe and nutritional databases.This project is the final project for the Modern Data Structures class at Columbia University for Fall 2023.FeaturesFetch and display recipes from a vast collection using the Spoonacular API.Gather and present nutritional data for ingredients using the Edamam API.Generate recipes based on user-provided ingredients and dietary preferences.Offer the ability to exclude certain ingredients from the recipe search.Provide summary statistics about the recipes such as calorie count and preparation time.InstallationTo install QuickBite, you will need Python 3.8 or later.From PyPIOnce QuickBite is available on PyPI, you can install it using pip:pipinstallquickbiteFor DevelopmentIf you wish to install QuickBite for development purposes, follow these steps:Clone the repository:gitclonehttps://github.com/<your-username>/QuickBite.gitNavigate to the project directory:cdQuickBiteInstall the package along with its dependencies:poetryinstallThis will create a virtual environment with all the necessary dependencies installed.UsageTo use QuickBite, run the following command in your terminal:quickbiteYou will be prompted to enter the ingredients you have on hand, separated by commas:Enter ingredients you have, separated by commas (e.g., eggs, flour, sugar):Next, you can specify any ingredients you wish to exclude from the recipe suggestions:Enter ingredients you want to exclude, separated by commas (e.g., nuts, dairy):QuickBite will then display a list of recipes that match your ingredients, and you can select one to see more details, including the recipe's nutritional information and a list of all needed ingredients.Here's an example of command usage:$ quickbite
Welcome to the Recipe Generator!

Enter ingredients you have, separated by commas (e.g., eggs, flour, sugar): chicken, rice

Enter ingredients you want to exclude, separated by commas (e.g., nuts, dairy):

Searching for recipes...

Available recipes:
1. Chicken and Rice Casserole
2. Spicy Chicken Stir Fry
3. Simple Chicken Biryani
4. Chicken Fried Rice

Enter the number of the recipe to get more information, or 'exit' to finish: 2

Fetching details for recipe: Spicy Chicken Stir Fry...

Nutritional Information:
Calories: 300
Protein: 25g
...

Ingredients List:
- Chicken breast: 2 pieces
- Rice: 1 cup
- Bell pepper: 1
- ...

Would you like to start over? (yes/no): noDevelopment SetupTo set up a development environment for QuickBite:Clone the repository:gitclonehttps://github.com/<your-username>/QuickBite.gitNavigate to the project directory:cdQuickBiteInstall dependencies using Poetry:poetryinstallActivate the virtual environment:poetryshellSet up environment variables:
Copy.env.exampleto.envand populate it with your API keys.FunctionsThe application includes the following defined functions:search_recipes_by_ingredients: Search for recipes based on a list of ingredients.search_recipes_excluding_ingredients: Filter recipes by excluding certain ingredients.get_nutritional_data: Retrieve nutritional information for a given ingredient.get_recipe_details: Fetch detailed information about a specific recipe.get_user_ingredients: Interactively get ingredients from the user.get_user_exclusions: Interactively get ingredient exclusions from the user.display_recipes: Display a list of recipes to the user.print_ingredients_list: Print out a formatted list of ingredients.get_ingredients_for_recipe: Extract and format ingredients for a specific recipe.format_nutritional_data: Format and display nutritional data.Challenges Faced and SolutionsThroughout the development of QuickBite, several technical challenges were encountered:API Rate Limiting: Both Spoonacular and Edamam APIs have rate limits which initially hindered the ability to collect large amounts of data continuously. To overcome this, I implemented a caching system that stores API responses, thereby reducing the number of necessary calls for repeated data requests.Data Inconsistency: The data retrieved from the APIs had inconsistencies in formatting, especially with units of measurement for ingredients. I created a normalization function that standardizes the units and formats the ingredient data into a consistent structure.Error Handling: Various exceptions and errors such as timeouts and HTTP errors were frequent during API interaction. I utilized try-except blocks to handle these exceptions gracefully and ensure the application could continue running without crashing.Environment Management: Managing API keys securely while allowing the application to be used on different machines was a concern. I used environment variables to handle API keys, making the application more secure and portable.These challenges were met with a focus on robustness and user experience, ensuring that the final product was not only functional but also reliable and easy to use.ContributingContributions are welcome. Please open an issue to discuss your ideas or submit a Pull Request.LicenseQuickBite is open-sourced under the MIT License, which provides a permissive free software license that allows for reuse within proprietary software provided all copies of the licensed software include a copy of the MIT License terms and the copyright notice.For the full license text, see theLICENSEfile.AcknowledgementsThis project is submitted as a part of the final coursework for the Modern Data Structures class under the guidance of Dr. Thomas Brambor, Columbia University QMSS, Fall 2023.Data provided by:Spoonacular APIEdamam API