recipebox_pkg
latest
  • Example usage
  • Changelog
  • Contributing
  • Code of Conduct
  • API Reference
    • recipebox_pkg
      • Submodules
        • recipebox_pkg.fetch_recipe
        • recipebox_pkg.id_search
        • recipebox_pkg.ing_search
        • recipebox_pkg.nutr_search
      • Package Contents
recipebox_pkg
  • API Reference
  • recipebox_pkg
  • recipebox_pkg.ing_search
  • Edit on GitHub

recipebox_pkg.ing_search

Module Contents

Functions

ingredient_search_recipe(api_key, ingredient_list[, ...])

Search for recipes based on specified ingredients using the Spoonacular API.

display_images_ingredients(df)

Display images for each recipe in a DataFrame.

recipebox_pkg.ing_search.ingredient_search_recipe(api_key, ingredient_list, number=5)[source]

Search for recipes based on specified ingredients using the Spoonacular API.

Parameters: - api_key (str): The API key for accessing the Spoonacular API. - ingredient_list (list): List of ingredients to search for in recipes. - number (int): The maximum number of recipes to retrieve (default is 5).

Returns: - pd.DataFrame or None: A DataFrame containing recipe information or None if no recipes are found.

recipebox_pkg.ing_search.display_images_ingredients(df)[source]

Display images for each recipe in a DataFrame.

Parameters: - df (pd.DataFrame): DataFrame containing recipe information, including ‘title’, ‘id’, and ‘image’ columns.

This function iterates over the DataFrame, printing the title and recipe ID for each row, and then displays the corresponding image.

Example: >>> df = pd.DataFrame({‘title’: [‘Spaghetti Carbonara’, ‘Chicken Alfredo’], … ‘id’: [123, 456], … ‘image’: [’https://example.com/spaghetti.jpg’, ‘https://example.com/chicken.jpg’]}) >>> display_images_ingredients(df)

Previous Next

© Copyright 2023, Yuchen An. Revision 157f4184.

Built with Sphinx using a theme provided by Read the Docs.