import pandas as pd
import numpy as np
import flagpy as fp
from great_tables import GT, style,loc, md, html, nanoplot_options
import io
import base64
import matplotlib.pyplot as plt
TidyTuesday dataset of September 16, 2025
= pd.read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-09-16/all_recipes.csv')
all_recipes = pd.read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/main/data/2025/2025-09-16/cuisines.csv') cuisines
all_recipes
name | url | author | date_published | ingredients | calories | fat | carbs | protein | avg_rating | total_ratings | reviews | prep_time | cook_time | total_time | servings | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Chewy Whole Wheat Peanut Butter Brownies | https://www.allrecipes.com/recipe/140717/chewy... | DMOMMY | 2020-06-18 | ⅓ cup margarine, softened, ⅔ cup white sugar, ... | 222.0 | 13.0 | 24.0 | 6.0 | 4.4 | 47.0 | 36.0 | 20 | 35 | 55 | 16.0 |
1 | Pumpkin Pie Eggnog | https://www.allrecipes.com/recipe/269204/pumpk... | Bobbie Susan | 2022-09-26 | 12 egg yolks, 2 cups heavy whipping cream, ½ ... | 477.0 | 31.0 | 43.0 | 8.0 | 5.0 | 1.0 | 1.0 | 10 | 5 | 495 | 8.0 |
2 | Eggs Poached in Tomato Sauce | https://www.allrecipes.com/recipe/238054/eggs-... | Bren | 2018-06-08 | 2 tablespoons olive oil, or to taste, ½ onion... | 354.0 | 18.0 | 32.0 | 20.0 | 4.8 | 4.0 | 4.0 | 10 | 75 | 85 | 4.0 |
3 | Minestrone Casserole | https://www.allrecipes.com/minestrone-casserol... | Sarah Brekke | 2025-03-03 | 4 cups dried mafalda pasta (mini lasagna noodl... | 356.0 | 9.0 | 53.0 | 19.0 | 4.3 | 14.0 | 13.0 | 20 | 40 | 60 | 8.0 |
4 | Yummy Stuffed Peppers | https://www.allrecipes.com/recipe/241937/yummy... | Procrastigirl | 2024-12-11 | 4 green bell peppers, halved lengthwise and se... | 366.0 | 22.0 | 23.0 | 19.0 | 4.7 | 84.0 | 67.0 | 30 | 95 | 125 | 8.0 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
14421 | Cheesy Kale Quiche | https://www.allrecipes.com/recipe/244249/chees... | ally-gator | 2022-01-14 | 1 (9 inch) pie crust pastry, ½ (8 ounce) packa... | 338.0 | 25.0 | 15.0 | 14.0 | 4.8 | 20.0 | 17.0 | 10 | 45 | 55 | 8.0 |
14422 | Fabulous Chicken Cordon Bleu Casserole | https://www.allrecipes.com/fabulous-chicken-co... | Lindsay Breeze | 2024-01-08 | 8 ounces egg noodles, 1/2 cup butter, 1/2 cup ... | 572.0 | 37.0 | 28.0 | 30.0 | 4.9 | 14.0 | 14.0 | 30 | 40 | 70 | 6.0 |
14423 | Absolutely Wonderful Cheesy, Creamy Spinach Ar... | https://www.allrecipes.com/recipe/262412/absol... | Shamrock Farms | 2022-01-14 | ½ cup Shamrock Farms® Premium Sour Cream, ½ cu... | 244.0 | 13.0 | 22.0 | 11.0 | NaN | NaN | NaN | 10 | 25 | 35 | 8.0 |
14424 | Gluten-Free Fruitcake | https://www.allrecipes.com/recipe/268501/glute... | Buckwheat Queen | 2023-01-22 | ¼ cup raisins, ¼ cup golden raisins, ¼ cup dri... | 401.0 | 20.0 | 45.0 | 5.0 | 5.0 | 6.0 | 6.0 | 40 | 90 | 1585 | 12.0 |
14425 | Chef John's Irish Pork Stew | https://www.allrecipes.com/recipe/236988/chef-... | John Mitzewich | 2024-11-16 | 1 (2 ½ pound) boneless pork shoulder, cut into... | 401.0 | 19.0 | 33.0 | 20.0 | 4.8 | 333.0 | 274.0 | 25 | 145 | 170 | 6.0 |
14426 rows × 16 columns
cuisines
name | country | url | author | date_published | ingredients | calories | fat | carbs | protein | avg_rating | total_ratings | reviews | prep_time | cook_time | total_time | servings | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | Saganaki (Flaming Greek Cheese) | Greek | https://www.allrecipes.com/recipe/263750/flami... | John Mitzewich | 2024-02-07 | 1 (4 ounce) package kasseri cheese, 1 tablespo... | 391.0 | 25.0 | 15.0 | 16.0 | 4.8 | 25.0 | 22.0 | 10 | 5 | 15 | 2.0 |
1 | Coney Island Knishes | Jewish | https://www.allrecipes.com/recipe/272334/coney... | John Mitzewich | 2024-11-26 | 2 ¾ cups all-purpose flour, or more as needed,... | 301.0 | 17.0 | 31.0 | 7.0 | 4.6 | 10.0 | 9.0 | 30 | 75 | 180 | 16.0 |
2 | Diana's Hawaiian Bread Rolls | Australian and New Zealander | https://www.allrecipes.com/recipe/22797/dianas... | CHIPPENDALE | 2022-07-14 | 1 ½ cups warm water (110 degrees F/45 degrees ... | 64.0 | 3.0 | 9.0 | 1.0 | 4.3 | 126.0 | 104.0 | 20 | 15 | 180 | 12.0 |
3 | Chilean Pebre | Chilean | https://www.allrecipes.com/recipe/273763/chile... | Heidi | 2025-01-31 | ½ cup chopped cilantro, ¼ cup olive oil, ¼ cup... | 106.0 | 9.0 | 7.0 | 1.0 | 5.0 | 1.0 | 1.0 | 10 | 0 | 10 | 6.0 |
4 | Tex-Mex Sheet Cake | Tex-Mex | https://www.allrecipes.com/recipe/22388/tex-me... | Ann | 2025-02-18 | 2 cups all-purpose flour, 1 ½ cups brown sugar... | 449.0 | 23.0 | 58.0 | 7.0 | 3.8 | 13.0 | 11.0 | 30 | 15 | 45 | 15.0 |
... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... | ... |
2213 | Chicken Satay Bowls with Spicy Peanut Sauce | Thai | https://www.allrecipes.com/chicken-satay-bowls... | LaDonna Langwell | 2025-06-02 | 1/4 cup coconut milk, 1 tablespoon brown sugar... | 716.0 | 42.0 | 41.0 | 48.0 | 5.0 | 3.0 | 3.0 | 30 | 15 | 165 | 4.0 |
2214 | The Best Ricotta Pancakes | Canadian | https://www.allrecipes.com/recipe/242225/the-b... | WestCoastMom | 2025-03-11 | 1 cup ricotta cheese plus, 2 tablespoons ricot... | 86.0 | 4.0 | 8.0 | 5.0 | 4.5 | 41.0 | 35.0 | 15 | 10 | 25 | 12.0 |
2215 | Black Pepper Chicken | Chinese | https://www.allrecipes.com/black-pepper-chicke... | Barrett Heald | 2024-03-05 | 1/4 cup cornstarch, 1 tablespoon reduced-sodiu... | 484.0 | 20.0 | 44.0 | 32.0 | 4.4 | 11.0 | 10.0 | 15 | 15 | 45 | 4.0 |
2216 | Chicken Florentine | French | https://www.allrecipes.com/chicken-florentine-... | Renu Dhar | 2024-01-18 | 1/4 cup all-purpose flour, 3/4 teaspoon kosher... | 571.0 | 33.0 | 12.0 | 50.0 | 4.8 | 17.0 | 17.0 | 15 | 20 | 35 | 4.0 |
2217 | Iskender Kebab | Persian | https://www.allrecipes.com/recipe/88080/iskend... | GATOULA | 2024-11-17 | 4 pita bread rounds, 1 tablespoon olive oil, ... | 667.0 | 36.0 | 49.0 | 37.0 | 4.5 | 17.0 | 12.0 | 15 | 15 | 30 | 4.0 |
2218 rows × 17 columns
= cuisines[(cuisines['avg_rating']==5) & (cuisines['total_time']<=10) & (cuisines['total_time']>0)]
cuisines_filtered cuisines_filtered
name | country | url | author | date_published | ingredients | calories | fat | carbs | protein | avg_rating | total_ratings | reviews | prep_time | cook_time | total_time | servings | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3 | Chilean Pebre | Chilean | https://www.allrecipes.com/recipe/273763/chile... | Heidi | 2025-01-31 | ½ cup chopped cilantro, ¼ cup olive oil, ¼ cup... | 106.0 | 9.0 | 7.0 | 1.0 | 5.0 | 1.0 | 1.0 | 10 | 0 | 10 | 6.0 |
9 | Pan con Tomate (Spanish Tomato Bread) | Spanish | https://www.allrecipes.com/pan-con-tomate-span... | Luis Luna | 2025-06-02 | 1 large tomato, chopped, 2 slices crusty bread... | 322.0 | 16.0 | 39.0 | 7.0 | 5.0 | 2.0 | 2.0 | 5 | 5 | 10 | 1.0 |
243 | Vietnamese Egg Coffee | Vietnamese | https://www.allrecipes.com/recipe/283318/vietn... | Yoly | 2021-02-09 | 1 large egg yolk, 2 tablespoons sweetened cond... | 175.0 | 8.0 | 21.0 | 6.0 | 5.0 | 1.0 | 1.0 | 5 | 0 | 5 | 1.0 |
330 | Spanish Gin and Tonic (Gin Tonica) | Spanish | https://www.allrecipes.com/spanish-gin-and-ton... | John Mitzewich | 2023-08-17 | whole spices, such as juniper berries, pink pe... | 366.0 | 2.0 | 74.0 | 7.0 | 5.0 | 1.0 | 1.0 | 9 | 0 | 9 | 1.0 |
507 | Homemade Za'atar | Lebanese | https://www.allrecipes.com/recipe/262666/homem... | Serena | 2022-08-22 | 3 tablespoons sesame seeds, 3 tablespoons fres... | 29.0 | 2.0 | 2.0 | 1.0 | 5.0 | 3.0 | 2.0 | 5 | 3 | 8 | 6.0 |
824 | Cuban Crunchwrap | Cuban | https://www.allrecipes.com/cuban-crunchwrap-re... | Nicole McLaughlin | 2025-04-03 | 1 extra large flour tortilla (12 inches or lar... | 2010.0 | 71.0 | 264.0 | 76.0 | 5.0 | 1.0 | 1.0 | 5 | 5 | 10 | 1.0 |
1061 | Coconut Rum Brazilian Lemonade | Brazilian | https://www.allrecipes.com/coconut-rum-brazili... | Nicole McLaughlin | 2024-06-13 | 2 limes, 2 cups water, 1/2 cup coconut rum, 1/... | 169.0 | 2.0 | 28.0 | 2.0 | 5.0 | 2.0 | 2.0 | 5 | 0 | 5 | 3.0 |
1216 | Italian Cherry Margarita | Italian | https://www.allrecipes.com/italian-cherry-marg... | Nicole McLaughlin | 2025-07-26 | 2 fresh cherries, pitted, or more to taste, pl... | 222.0 | 0.0 | 16.0 | 0.0 | 5.0 | 1.0 | 1.0 | 5 | 0 | 5 | 1.0 |
1226 | Indian Summer Raspberry Peach Sangria | Spanish | https://www.allrecipes.com/recipe/233339/india... | Robert Farabaugh | 2025-07-24 | 1 (750 milliliter) bottle red wine, 24 fluid o... | 175.0 | 0.0 | 22.0 | 1.0 | 5.0 | 8.0 | 4.0 | 10 | 0 | 10 | 8.0 |
1516 | Chocolate Santafereño (Colombian-Style Hot Cho... | Colombian | https://www.allrecipes.com/chocolate-santafere... | Devon O'Brien | 2024-10-07 | 1 cup whole milk, 2 ounces bittersweet or dark... | 544.0 | 32.0 | 47.0 | 17.0 | 5.0 | 1.0 | 1.0 | 5 | 5 | 10 | 1.0 |
1581 | Lebanese 7 Spices | Lebanese | https://www.allrecipes.com/recipe/269331/leban... | BigDaddy | 2018-11-30 | 1 tablespoon ground nutmeg, 1 tablespoon groun... | 15.0 | 1.0 | 3.0 | 1.0 | 5.0 | 2.0 | 2.0 | 5 | 0 | 5 | 10.0 |
1654 | Easy Mojitos | Cuban | https://www.allrecipes.com/recipe/229649/easy-... | Jennifer | 2025-05-12 | 12 leaves mint, 2 lime slices, 1 teaspoon whi... | 121.0 | 0.0 | 7.0 | 0.0 | 5.0 | 24.0 | 20.0 | 5 | 0 | 5 | 1.0 |
1822 | Dave Matthews | Canadian | https://www.allrecipes.com/recipe/201058/dave-... | looloo2 | 2022-09-25 | 1 fluid ounce coconut-flavored rum, 1 fluid ou... | NaN | NaN | NaN | NaN | 5.0 | 11.0 | 8.0 | 5 | 0 | 5 | 1.0 |
1996 | Authentic Chimichurri | Argentinian | https://www.allrecipes.com/recipe/278453/authe... | Avon- status quo PRO | 2024-06-27 | 1 cup fresh parsley, ½ cup extra-virgin olive ... | 133.0 | 14.0 | 1.0 | 0.0 | 5.0 | 5.0 | 4.0 | 10 | 0 | 10 | 8.0 |
cuisines_filtered.columns
Index(['name', 'country', 'url', 'author', 'date_published', 'ingredients',
'calories', 'fat', 'carbs', 'protein', 'avg_rating', 'total_ratings',
'reviews', 'prep_time', 'cook_time', 'total_time', 'servings'],
dtype='object')
= cuisines_filtered[['name', 'country', 'ingredients',
cuisines_final 'calories', 'fat', 'carbs', 'protein',
'prep_time', 'cook_time']].sort_values(by='country').reset_index(drop=True)
cuisines_final
name | country | ingredients | calories | fat | carbs | protein | prep_time | cook_time | |
---|---|---|---|---|---|---|---|---|---|
0 | Authentic Chimichurri | Argentinian | 1 cup fresh parsley, ½ cup extra-virgin olive ... | 133.0 | 14.0 | 1.0 | 0.0 | 10 | 0 |
1 | Coconut Rum Brazilian Lemonade | Brazilian | 2 limes, 2 cups water, 1/2 cup coconut rum, 1/... | 169.0 | 2.0 | 28.0 | 2.0 | 5 | 0 |
2 | Dave Matthews | Canadian | 1 fluid ounce coconut-flavored rum, 1 fluid ou... | NaN | NaN | NaN | NaN | 5 | 0 |
3 | Chilean Pebre | Chilean | ½ cup chopped cilantro, ¼ cup olive oil, ¼ cup... | 106.0 | 9.0 | 7.0 | 1.0 | 10 | 0 |
4 | Chocolate Santafereño (Colombian-Style Hot Cho... | Colombian | 1 cup whole milk, 2 ounces bittersweet or dark... | 544.0 | 32.0 | 47.0 | 17.0 | 5 | 5 |
5 | Cuban Crunchwrap | Cuban | 1 extra large flour tortilla (12 inches or lar... | 2010.0 | 71.0 | 264.0 | 76.0 | 5 | 5 |
6 | Easy Mojitos | Cuban | 12 leaves mint, 2 lime slices, 1 teaspoon whi... | 121.0 | 0.0 | 7.0 | 0.0 | 5 | 0 |
7 | Italian Cherry Margarita | Italian | 2 fresh cherries, pitted, or more to taste, pl... | 222.0 | 0.0 | 16.0 | 0.0 | 5 | 0 |
8 | Homemade Za'atar | Lebanese | 3 tablespoons sesame seeds, 3 tablespoons fres... | 29.0 | 2.0 | 2.0 | 1.0 | 5 | 3 |
9 | Lebanese 7 Spices | Lebanese | 1 tablespoon ground nutmeg, 1 tablespoon groun... | 15.0 | 1.0 | 3.0 | 1.0 | 5 | 0 |
10 | Pan con Tomate (Spanish Tomato Bread) | Spanish | 1 large tomato, chopped, 2 slices crusty bread... | 322.0 | 16.0 | 39.0 | 7.0 | 5 | 5 |
11 | Spanish Gin and Tonic (Gin Tonica) | Spanish | whole spices, such as juniper berries, pink pe... | 366.0 | 2.0 | 74.0 | 7.0 | 9 | 0 |
12 | Indian Summer Raspberry Peach Sangria | Spanish | 1 (750 milliliter) bottle red wine, 24 fluid o... | 175.0 | 0.0 | 22.0 | 1.0 | 10 | 0 |
13 | Vietnamese Egg Coffee | Vietnamese | 1 large egg yolk, 2 tablespoons sweetened cond... | 175.0 | 8.0 | 21.0 | 6.0 | 5 | 0 |
# merge calories, fat, carbs, and protein cols into one col as a list of four elements.
'nutrition'] = cuisines_final[['fat', 'carbs', 'protein']].values.tolist()
cuisines_final[# in calories, fat, protein, carbs, replace nan with 0.0
'calories', 'fat', 'carbs', 'protein']] = cuisines_final[['calories', 'fat', 'carbs', 'protein']].fillna(0.0)
cuisines_final[[# convert nutrition col to string
'nutrition'] = cuisines_final['nutrition'].apply(
cuisines_final[lambda x: ', '.join([str(0.0 if pd.isna(i) else i) for i in x])
) cuisines_final
name | country | ingredients | calories | fat | carbs | protein | prep_time | cook_time | nutrition | |
---|---|---|---|---|---|---|---|---|---|---|
0 | Authentic Chimichurri | Argentinian | 1 cup fresh parsley, ½ cup extra-virgin olive ... | 133.0 | 14.0 | 1.0 | 0.0 | 10 | 0 | 14.0, 1.0, 0.0 |
1 | Coconut Rum Brazilian Lemonade | Brazilian | 2 limes, 2 cups water, 1/2 cup coconut rum, 1/... | 169.0 | 2.0 | 28.0 | 2.0 | 5 | 0 | 2.0, 28.0, 2.0 |
2 | Dave Matthews | Canadian | 1 fluid ounce coconut-flavored rum, 1 fluid ou... | 0.0 | 0.0 | 0.0 | 0.0 | 5 | 0 | 0.0, 0.0, 0.0 |
3 | Chilean Pebre | Chilean | ½ cup chopped cilantro, ¼ cup olive oil, ¼ cup... | 106.0 | 9.0 | 7.0 | 1.0 | 10 | 0 | 9.0, 7.0, 1.0 |
4 | Chocolate Santafereño (Colombian-Style Hot Cho... | Colombian | 1 cup whole milk, 2 ounces bittersweet or dark... | 544.0 | 32.0 | 47.0 | 17.0 | 5 | 5 | 32.0, 47.0, 17.0 |
5 | Cuban Crunchwrap | Cuban | 1 extra large flour tortilla (12 inches or lar... | 2010.0 | 71.0 | 264.0 | 76.0 | 5 | 5 | 71.0, 264.0, 76.0 |
6 | Easy Mojitos | Cuban | 12 leaves mint, 2 lime slices, 1 teaspoon whi... | 121.0 | 0.0 | 7.0 | 0.0 | 5 | 0 | 0.0, 7.0, 0.0 |
7 | Italian Cherry Margarita | Italian | 2 fresh cherries, pitted, or more to taste, pl... | 222.0 | 0.0 | 16.0 | 0.0 | 5 | 0 | 0.0, 16.0, 0.0 |
8 | Homemade Za'atar | Lebanese | 3 tablespoons sesame seeds, 3 tablespoons fres... | 29.0 | 2.0 | 2.0 | 1.0 | 5 | 3 | 2.0, 2.0, 1.0 |
9 | Lebanese 7 Spices | Lebanese | 1 tablespoon ground nutmeg, 1 tablespoon groun... | 15.0 | 1.0 | 3.0 | 1.0 | 5 | 0 | 1.0, 3.0, 1.0 |
10 | Pan con Tomate (Spanish Tomato Bread) | Spanish | 1 large tomato, chopped, 2 slices crusty bread... | 322.0 | 16.0 | 39.0 | 7.0 | 5 | 5 | 16.0, 39.0, 7.0 |
11 | Spanish Gin and Tonic (Gin Tonica) | Spanish | whole spices, such as juniper berries, pink pe... | 366.0 | 2.0 | 74.0 | 7.0 | 9 | 0 | 2.0, 74.0, 7.0 |
12 | Indian Summer Raspberry Peach Sangria | Spanish | 1 (750 milliliter) bottle red wine, 24 fluid o... | 175.0 | 0.0 | 22.0 | 1.0 | 10 | 0 | 0.0, 22.0, 1.0 |
13 | Vietnamese Egg Coffee | Vietnamese | 1 large egg yolk, 2 tablespoons sweetened cond... | 175.0 | 8.0 | 21.0 | 6.0 | 5 | 0 | 8.0, 21.0, 6.0 |
'country'].unique() cuisines_final[
array(['Argentinian', 'Brazilian', 'Canadian', 'Chilean', 'Colombian',
'Cuban', 'Italian', 'Lebanese', 'Spanish', 'Vietnamese'],
dtype=object)
= ['Argentina', 'Brazil', 'Canada', 'Chile', 'Colombia', 'Cuba', 'Italy', 'Lebanon', 'Spain', 'Vietnam'] country_list
# save flag for each country
for country in country_list:
= fp.get_flag_img(country)
img f'{country}_flag.png') img.save(
= {
country_image_paths 'Argentinian': 'Argentina_flag.png',
'Brazilian': 'Brazil_flag.png',
'Canadian': 'Canada_flag.png',
'Chilean': 'Chile_flag.png',
'Colombian': 'Colombia_flag.png',
'Cuban': 'Cuba_flag.png',
'Italian': 'Italy_flag.png',
'Lebanese': 'Lebanon_flag.png',
'Spanish': 'Spain_flag.png',
'Vietnamese': 'Vietnam_flag.png'
}
'flag']=cuisines_final['country'].map(country_image_paths) cuisines_final[
cuisines_final.columns
Index(['name', 'country', 'ingredients', 'calories', 'fat', 'carbs', 'protein',
'prep_time', 'cook_time', 'nutrition', 'flag'],
dtype='object')
def create_tally_image(n, color='black'):
"""Create tally mark image with diagonal going from bottom-left to top-right"""
= n // 5
groups = n % 5
remainder
# Calculate figure width based on number of marks
# Each group takes 0.7 width (0.5 for marks + 0.2 space)
# Each remainder takes 0.1 width
= max(1.0, 0.7 * groups + 0.1 * remainder + 0.2)
total_width
= plt.subplots(figsize=(total_width, 0.5))
fig, ax 0, total_width)
ax.set_xlim(0, 1)
ax.set_ylim('off')
ax.axis(
= 0.1
x_start for i in range(groups):
# Four vertical bars
for j in range(4):
+ j*0.1, x_start + j*0.1], [0.2, 0.8], color=color, lw=2)
ax.plot([x_start
# Diagonal from bottom-left to top-right
# Starts below and left of first line, ends above and right of fourth line
- 0.05, x_start + 0.35], [0.15, 0.85], color=color, lw=2)
ax.plot([x_start
# Add space after group
+= 0.7 # 0.5 for marks + 0.2 space
x_start
# Draw remaining marks
for j in range(remainder):
+ j*0.1, x_start + j*0.1], [0.2, 0.8], color=color, lw=2)
ax.plot([x_start
# Save to memory
= io.BytesIO()
buf format='png', bbox_inches='tight', pad_inches=0.1, transparent=True)
plt.savefig(buf, 0)
buf.seek(= base64.b64encode(buf.read()).decode('utf-8')
img_str
plt.close(fig)
return f'<img src="data:image/png;base64,{img_str}" style="height:30px">'
"prep_Tally"] = cuisines_final["prep_time"].apply(create_tally_image, args=('purple',))
cuisines_final["cook_Tally"] = cuisines_final["cook_time"].apply(create_tally_image, args=('dodgerblue',)) cuisines_final[
= (
gt_table 'name', 'flag', 'ingredients', 'prep_Tally', 'cook_Tally', 'nutrition','calories']], rowname_col='name')
GT(cuisines_final[[
.cols_width({'name': '15%',
'flag': '8%',
'ingredients': '45%',
'calories': '6%',
# 'prep_time': '5%',
# 'cook_time': '6%',
'nutrition': '15%',
'prep_Tally': '5%',
'cook_Tally': '6%'
})="Time (mins)", columns=["prep_Tally", "cook_Tally"])
.tab_spanner(label="Nutrition", columns=["calories","nutrition"])
.tab_spanner(label
.tab_style(=style.text(weight="bold"),
style=loc.spanner_labels(["Time (mins)", "Nutrition"])
locations
)
.tab_header(=md("**Five star** cuisines having preparation time upto **ten minutes**."),
title# subtitle="Recipes with 5 star ratings and total time less than 10 minutes"
)
.cols_label(="Prep",
prep_Tally="Cook",
cook_Tally="Calories",
calories="Country",
flag="Ingredients",
ingredients="Fat, Carbs, Protein"
nutrition
)=["calories"], decimals=0)
.fmt_number(columns="nutrition", plot_type='bar',options=nanoplot_options(data_bar_fill_color="green"))
.fmt_nanoplot(columns='ingredients')
.fmt_markdown(columns'center')
.cols_align(="left", columns=["ingredients"])
.cols_align(align
.tab_style(=style.text(align="center"), # Center header text
style=loc.column_labels(columns=["ingredients"])
locations
)
.tab_style(=style.text(weight="bold"), # Center header text
style=loc.column_labels(columns=["flag","ingredients"])
locations
)
.data_color(=['calories'],
columns='Reds',
palette=[cuisines_final['calories'].min(), cuisines_final['calories'].max()]
domain
)
.tab_style(=[
style='normal'), # Text wrapping
style.text(whitespace='papayawhip') # Background fill
style.fill(color
],=loc.body(columns='ingredients'))
locations
.tab_style(=[
style='normal'),
style.text(whitespace='aliceblue')
style.fill(color
],=loc.stub()
locations
)
.tab_style(=style.text(color="purple"), #, weight="bold", size="16px"),
style=loc.column_labels(columns=["prep_Tally"])
locations
)
.tab_style(=style.text(color="dodgerblue"),
style=loc.column_labels(columns=["cook_Tally"])
locations
)='100%')
.tab_options(table_width
.fmt_image(=['flag'], path="."
columns
)
.tab_source_note(="Data: allrecipies.com"
source_note
)
.tab_style(=style.css("border:0px"),
style=loc.body(columns=["flag"])
locations
)
.tab_style(=style.css("border-radius: 50px;"),
style=loc.body(columns=["calories"])
locations
)
)
#gt_table.save("table.html")
# Save html without selenium
= gt_table.as_raw_html()
html with open("table.html", "w") as f:
f.write(html)
gt_table
#gt_table.save(
# file="my_table.png",
# selector="table", # HTML selector to capture
# scale=1.0, # Zoom level
# expand=5, # Padding around the image
# window_size=(1000, 800) # Size of the browser window used for rendering
#)
Five star cuisines having preparation time upto ten minutes. | ||||||
---|---|---|---|---|---|---|
Country | Ingredients | Time (mins) | Nutrition | |||
Prep | Cook | Calories | Fat, Carbs, Protein | |||
Authentic Chimichurri | 1 cup fresh parsley, ½ cup extra-virgin olive oil, 2 tablespoons fresh oregano, 2 tablespoons red wine vinegar, 1 tablespoon water, 1 jalapeño chile pepper, seeded, 2 cloves garlic, chopped, ½ teaspoon salt, ½ teaspoon ground black pepper | 133 | ||||
Coconut Rum Brazilian Lemonade | 2 limes, 2 cups water, 1/2 cup coconut rum, 1/4 cup sweetened condensed milk, 2 cups ice | 169 | ||||
Dave Matthews | 1 fluid ounce coconut-flavored rum, 1 fluid ounce amaretto liqueur, ¼ fluid ounce fresh lime juice, ¾ fluid ounce pineapple juice, ½ fluid ounce cranberry juice | 0 | ||||
Chilean Pebre | ½ cup chopped cilantro, ¼ cup olive oil, ¼ cup red wine vinegar, 1 tomato, chopped, 1 small onion, chopped, 1 lemon, juiced, 2 chile peppers, seeded and chopped, 2 tablespoons minced garlic, salt and pepper to taste | 106 | ||||
Chocolate Santafereño (Colombian-Style Hot Chocolate) | 1 cup whole milk, 2 ounces bittersweet or dark chocolate(85% cacao), 1 pinch cinnamon, 1 pinch ground cloves, 1 (1-ounce) mozzarella cube | 544 | ||||
Cuban Crunchwrap | 1 extra large flour tortilla (12 inches or larger), 2 ounces sliced ham, 2 ounces cooked pork, 2 teaspoons mustard, 1/2 cup kettle potato chips, 1/4 cup shredded Swiss cheese, 4 dill pickle slices, 1 tablespoon butter | 2,010 | ||||
Easy Mojitos | 12 leaves mint, 2 lime slices, 1 teaspoon white sugar, or more to taste, ¼ cup ice cubes, or as needed, 1 (1.5 fluid ounce) jigger rum (such as Bacardi), 4 ½ ounces diet lemon-lime soda (such as Diet Sprite) | 121 | ||||
Italian Cherry Margarita | 2 fresh cherries, pitted, or more to taste, plus more for garnish, 2 teaspoons fresh lime juice, 1 1/2 fluid ounces reposado tequila, 1 fluid ounce amaretto liqueur | 222 | ||||
Homemade Za'atar | 3 tablespoons sesame seeds, 3 tablespoons fresh thyme leaves, 1 tablespoon sumac powder, ½ teaspoon salt | 29 | ||||
Lebanese 7 Spices | 1 tablespoon ground nutmeg, 1 tablespoon ground ginger, 1 tablespoon ground allspice, 1 tablespoon fenugreek seeds, 1 tablespoon freshly ground black pepper, 1 teaspoon ground cloves, 1 teaspoon cinnamon | 15 | ||||
Pan con Tomate (Spanish Tomato Bread) | 1 large tomato, chopped, 2 slices crusty bread, 1 clove garlic, halved, 1 tablespoon extra-virgin olive oil, or to taste, sea salt to taste | 322 | ||||
Spanish Gin and Tonic (Gin Tonica) | whole spices, such as juniper berries, pink peppercorns, star anise, cardamom pods, cloves, or cinnamon sticks, 2 fluid ounces gin, 4 to 6 fluid ounces tonic water, to taste, sliced fresh citrus fruit, such as lemon, orange, lime, or blood orange, fresh herbs, such as basil, thyme, mint, rosemary, or tarragon | 366 | ||||
Indian Summer Raspberry Peach Sangria | 1 (750 milliliter) bottle red wine, 24 fluid ounces raspberry-flavored soda water, ½ cup peach schnapps, ½ cup pomegranate juice, ½ cup fresh lemon juice, 2 peaches, sliced, 2 lemons, sliced, 1 cup fresh raspberries, 1 orange, sliced, 4 cups ice cubes, or as desired | 175 | ||||
Vietnamese Egg Coffee | 1 large egg yolk, 2 tablespoons sweetened condensed milk, ½ cup hot strong coffee | 175 | ||||
Data: allrecipies.com |