Skip to content

My Final Project for CS50P: A Python-based web application that enables users to search for recipes based on preferences, view ingredients, and access cooking instructions.

Notifications You must be signed in to change notification settings

nizaraquil/The-Web-Cookbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

The Web Cookbook App

Description:

The Web Cookbook is a Python-based web application. Leveraging the capabilities of Streamlit and integrating seamlessly with the Spoonacular API, this app offers a user-friendly, simple and comprehensive recipe search experience.

Recipe Search

The primary functionality of The Web Cookbook revolves around simplifying the process of finding recipes tailored to individual preferences. Users can input their desired recipe queries, select specific dietary needs, and effortlessly obtain a curated list of recipes matching their criteria. Whether it's a search for gluten-free desserts or high-protein dinners, the app caters to diverse culinary preferences.

Features

The application's core features empower users in multiple ways:

  1. Search Capabilities: The intuitive interface allows users to input their desired recipes, triggering an efficient search mechanism that swiftly fetches relevant recipe suggestions.
  2. Customized Dietary Preferences: Accommodating various dietary requirements, users can refine their search by specifying preferences and intolerances, ensuring the displayed recipes align with their nutritional needs.
  3. Recipe Details: Upon receiving search results, users can delve deeper into specific recipes, accessing comprehensive ingredient lists and step-by-step cooking instructions to recreate their favorite dishes.

Simple Setup and Usage

Getting started with The Web Cookbook is hassle-free:

  1. Installation: With Python 3.x installed, users can clone or download the repository and effortlessly install necessary packages by executing a single command (pip install -r requirements.txt).
  2. Launch and Navigation: Running the application via streamlit run app.py instantly provides users with a URL to access the app in their preferred browser, where they can seamlessly explore recipe options.

Structural Overview

Understanding the file structure is beneficial for those exploring the application:

  • app.py: This file contains thecodebase for the Streamlit application.
  • requirements.txt: A file listing all required Python packages.

Code Documentation

Functions:

  • main() Function:

    • Purpose: Controls the primary functionalities of the Streamlit application.
    • Responsibilities:
      • Receives user input for recipe search criteria (query, dietary preferences, and intolerances).
      • Retrieves and displays recipe information, including ingredients and instructions.
      • Handles potential errors during API requests.
  • get_recipe(query, diet, intolerances) Function

    • Purpose: Fetches recipes from the Spoonacular API based on user input criteria.
    • Parameters:
      • query
      • diet
      • intolerances
    • Returns JSON response containing recipes and their details.
  • get_ingredients(recipe_id) Function

    • purpose: Fetches ingredients for a selected recipe identified by a unique id from the Spoonacular API.
    • Parameters:
      • recipe_id
    • Returns JSON response with ingredient information.
  • get_instructions(recipe_id) Function

    • purpose: Retrieves instructions for a selected recipe identified by a unique id from the Spoonacular API.
    • Parameters:
      • recipe_id
    • Returns JSON response with cooking instructions.

Dependencies:

  • requests:
    • Purpose: Used to make HTTP requests to the Spoonacular API to fetch recipe data.

Important Notes

A few essential considerations enhance the understanding and usage of The Web Cookbook:

  • API Integration: The application seamlessly integrates with the Spoonacular API, leveraging its extensive database to fetch and present recipe data based on user queries.
  • Error Handling: Robust error handling mechanisms are embedded within the app, ensuring graceful management of potential API request failures and providing a smooth user experience even in less-than-ideal conditions.

In conclusion, The Web Cookbook is more than just a recipe search platform; it's a user-friendly tool designed to cater to diverse culinary preferences while ensuring an enjoyable user experience.

About

My Final Project for CS50P: A Python-based web application that enables users to search for recipes based on preferences, view ingredients, and access cooking instructions.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages