recipebox_pkg.fetch_recipe
Module Contents
Functions
|
Search for recipes based on a specified query and additional parameters using the Spoonacular API. |
|
Convert recipe information from Spoonacular API response to a styled DataFrame. |
- recipebox_pkg.fetch_recipe.search_recipes(api_key, query, r_diet=None, r_excludeIngredients=None, r_intolerances=None, r_number=10)[source]
Search for recipes based on a specified query and additional parameters using the Spoonacular API.
Parameters: - api_key (str): The API key for accessing the Spoonacular API. - query (str): The search query for recipes. - r_diet (str): The diet type to filter recipes (e.g., ‘vegetarian’, ‘vegan’). - r_excludeIngredients (str): Ingredients to exclude from the recipes. - r_intolerances (str): Intolerances to consider when searching for recipes. - r_number (int): The maximum number of recipes to retrieve (default is 10).
Returns: - dict or None: A dictionary containing recipe information or None if an error occurs.
- recipebox_pkg.fetch_recipe.convert_recipes(response)[source]
Convert recipe information from Spoonacular API response to a styled DataFrame.
Parameters: - response (dict): The response from the Spoonacular API containing recipe information.
Returns: - pd.io.formats.style.Styler: A styled DataFrame with selected columns and formatted ‘sourceUrl’ column.