Spaces:
Sleeping
Sleeping
import streamlit as st | |
def app(): | |
#st.set_page_config(page_title='Calorie Calculator for Korean Food') | |
st.title("Calorie Calculator for Korean Food") | |
st.write("Enter the name of a food item with the serving amount") | |
st.markdown(""" | |
<style> | |
body { | |
color: #000; | |
background-color: #CF9FFF; | |
} | |
</style> | |
""", unsafe_allow_html=True) | |
import pandas as pd | |
df1 = pd.read_csv('Korean food_calorie__.csv',index_col=0) | |
dish = st.selectbox("Select the name of dish ",('Kimbap/๊น๋ฐฅ','Tteokbokki/๋ก๋ณถ์ด','Kalguksu/์นผ๊ตญ์','Gopchang-jeongol/๊ณฑ์ฐฝ์ ๊ณจ','Chadolbagi/์ฐจ๋๋ฐ๊ธฐ','Samgyeopsal/์ผ๊ฒน์ด','Panjeon/ํ์ ','Korean Tofu Kimchi Soup/๋๋ถ ๊น์น์ฐ๊ฐ','Samgetang/์ผ๊ณํ','Pork Ribs/๋ผ์ง ๊ฐ๋น','Dumplings/๋ง๋','Carrots In Korean/๋น๊ทผ ํ๊ตญ์ด','Galbi Jjim/๊ฐ๋น์ฐ','Bibimbap/๋น๋น๋ฐฅ','Yeongyang dolsatbap/์์ ๋์ฅ๋ฐฅ','Carrot Salad/๋น๊ทผ ์๋ฌ๋','Korean Food Lunch/ํ์ ์ ์ฌ','Ddukbaegi Bulgogi/๋๋ฐฐ๊ธฐ ๋ถ๊ณ ๊ธฐ','Jjamppong/์งฌ๋ฝ','Octopus bibimbap/๋ฌธ์ด๋น๋น๋ฐฅ','Sujebi/์์ ๋น','Dumpling Soup/๋ง๋ ์ํ','Yukgaejang/์ก๊ฐ์ฅ','Beef bulgogi/์๋ถ๊ณ ๊ธฐ','Vegetable Dumbling/์ผ์ฑ ๋ค๋ธ๋ง','Bulgogi/๋ถ๊ณ ๊ธฐ','Korean cold noodles/ํ๊ตญ ๋๋ฉด','Korean Eel soup/์ฅ์ดํ','Sundubu/์๋๋ถ','Korean Homemade food/ํ๊ตญ ์ง์์ ๋ง๋ ์์','Bibimnangmein/๋น๋น๋ญ๋ง์ธ','Bi Bim Bap/๋น๋น๋ฐฅ','Noodle/๊ตญ์','Galbi-tang /๊ฐ๋นํ','Bibimbap With Beef/์๊ณ ๊ธฐ ๋น๋น๋ฐฅ','Ginseng Chicken Soup/์ธ์ผ ์นํจ ์ํ','Dwen Jang Jigae/๋์ฌ ์ฅ์ง๊ฐ','Korean Beef Noodles/ํ์ฐ๊ตญ์','Tofu Kimchi/๋๋ถ','Makchang/๋ง์ฐฝ','Steamed Monkfish/์๊ท์ฐ','Sundaegukbab/์๋๊ตญ๋ฐฅ','Doganitang/๋๊ฐ๋ํ','Bulgogi /๋ถ๊ณ ๊ธฐ','Eomukguk/์ด๋ฌต๊ตญ','Soon Dae/์๋','Sirloin Steak/๋ฑ์ฌ ์คํ ์ดํฌ','Oi Kimchi/์ค์ด ๊น์น','Tempah/ํ ํ','Seaweed Salad/๋ฏธ์ญ ์๋ฌ๋','Hobbang/ํธ๋ฑ ','Broiled Eels/๊ตฌ์ด ์ฅ์ด','Korean bbq/ํ๊ตญ์ ๋ฐ๋ฒ ํ','Nori/Seaweed/๊น','Upjinsal roast/์์ง์ด ๊ตฌ์ด','Samgyupsal Pork Belly/์ผ๊ฒน์ด ์ผ๊ฒน์ด','JwiPo/์ฃผ์ดํฌ','Kim Bugak/๋ฏธ์ญ ์ค๋ต','Sogogi Youkgajang/์๊ณ ๊ธฐ์ก๊ฐ์ฅ','Korean bbq marinade/ํ๊ตญ์ ๋ฐ๋ฒ ํ ๋ง๋ฆฌ๋ค์ด๋','Self heating food/์์ฒด ๊ฐ์ด ์ํ','Korean Chicken Stir-Fry/ํ๊ตญ ์นํจ ๋ณถ์','Beef Intestine /์ ๊ณ ๊ธฐ ์ฐฝ์','Pork Bone Soup โ Gamjatang/๊ฐ์ํ','Ojingeo Deopbap/์ค์ง์ด๋ฎ๋ฐฅ','Ddukbokkie/๋ก๋ณถ์ด','Dwenjanggigae/์ฌ์ฅ๊ธฐ๊ฐ','Ja Jang Myeon/์์ฅ๋ฉด','Doenjang Soup With Spinach/์๊ธ์น ๋์ฅ๊ตญ','Korean Biscuit/ํ๊ตญ ๊ณผ์','Seasoned Tofu /์๋ ๋๋ถ','Korean Short Rib Soup/ํ์ ๊ฐ๋นํ','Roasted Pork Belly /๊ตฌ์ด ์ผ๊ฒน์ด','Tteokguk/์ถํ ์ํ','Korean beef/ํ์ฐ','Dak kkochi/๋ก๋ณถ์ด','Rice Cake Soup/๋ก๊ตญ','Stuffed Cucumber Kimchi/์ค์ด ๋ฐ์ ๊น์น','Yeot/์ฏง์ฏง','Gim/๊น','Triangular kimbap/์ผ๊ฐ๊น๋ฐฅ','Baked Chub Mackerel/๊ตฌ์ด ๊ณ ๋ฑ์ด','Bebimbap/๋น๋น๋ฐฅ','Bread Ttoah/๋นต๋์','Korean seaweed/ํ๊ตญ ํด์ด','Saeukkang/์๊ฐ','Bread Ttoah/๋นต๋์','Korean seaweed/ํ๊ตญ ํด์ด','Udon boeuf/์ฐ๋๋ถํ','Korean Kimchi/ํ๊ตญ ๊น์น','Korean Bbq/ํ๊ตญ์ ๋ฐ๋ฒ ํ','Dashida/๋ค์๋ค','Galbitang/๊ฐ๋นํ','Kimchi/๊น์น','Bibimbap vegetables/๋น๋น๋ฐฅ ์ผ์ฑ','Korean Chicken/ํ๊ตญ ์นํจ','Sikhye/์ํ','Saeng Maekju/์๋งฅ์ฃผ','Patbingsu/ํฅ๋น์','Tangpyeongchae/ํํ์ฑ')) | |
serving_ = st.number_input("Enter number of Servings") | |
try: | |
index_ = df1.index[df1['Name of the food']==dish].item() | |
except ValueError: | |
index_ = 1 | |
else: | |
recipe_ = df1['Recipe'][index_] | |
cal_ = df1['Calories'][index_] | |
carb_ = df1['Carb(g)'][index_] | |
fat_ = df1['Fat (g)'][index_] | |
proteins_ = df1['Proteins(g)'][index_] | |
image_ = df1['Image'][index_] | |
kd = df1['Korean Description'][index_] | |
st.write("**Calorie count** ",round(cal_*serving_,2)) | |
st.write("**Carbohydrate value** ",round(carb_*serving_,2)) | |
st.write("**Fat value** ",round(fat_*serving_,2)) | |
st.write("**Protein intake** ",round(proteins_*serving_,2)) | |
st.write("**Recipe**",recipe_) | |
st.write("**Description in Korean**",kd) | |
st.image(image_,width=500) | |