ShreyaRao commited on
Commit
9717f60
1 Parent(s): a770f16

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +41 -0
app.py ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import time,datetime
3
+ import json
4
+ from streamlit_lottie import st_lottie
5
+ from streamlit_extras.add_vertical_space import add_vertical_space
6
+ from streamlit_extras.colored_header import colored_header
7
+
8
+ st.set_page_config(page_title="Quotes", page_icon=":lower_left_fountain_pen:", layout="wide")
9
+
10
+ con = sqlite3.connect("Quotes.db")
11
+ cur=con.cursor()
12
+
13
+ #loading json animation
14
+ with open('123755-designers.json', 'r') as f:
15
+ lottie_json = json.load(f)
16
+ col1, col2 = st.columns([1, 3])
17
+ with col1:
18
+ st_lottie(lottie_json, speed=1, width=124, height=120, key='lottie')
19
+ with col2:
20
+ st.markdown("<link href='https://fonts.googleapis.com/css2?family=Rammetto One&display=swap' rel='stylesheet'>",unsafe_allow_html=True)
21
+ st.markdown("<h2><span style='text-align: center; color: violet;font-size: 70px; font-family:Rammetto One;'>Quotes</span> <span style='color: orange;font-size: 70px;font-family:Rammetto One, cursive;'>For</span> <span style='color: blue;font-size: 70px;font-family:Rammetto One, cursive;'>U</span></h2>", unsafe_allow_html=True)
22
+ colored_header(
23
+ label="",
24
+ description="",
25
+ color_name="violet-70",
26
+ )
27
+ d=st.date_input("Select a date",min_value=datetime.date(2023,3,30),
28
+ max_value=datetime.date.today())
29
+ formatted_date = d.strftime('%Y-%m-%d')
30
+
31
+
32
+
33
+ # Query the Snowflake database and retrieve data
34
+ rows = cur.execute("select quote,author from q where id = (?)",(formatted_date,)).fetchone()
35
+
36
+ txt1 = '<span style="color:midnightblue;font-size: 45px;font-family:Belgrano">{}</span>'.format(rows[0])
37
+ txt2='<span style="color: midnightblue;font-size: 40px;font-family:Belgrano;">{}</span>'.format(rows[1])
38
+
39
+ st.markdown(txt1, unsafe_allow_html=True)
40
+ add_vertical_space(1)
41
+ st.markdown(txt2,unsafe_allow_html=True)