Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import requests
|
|
2 |
import streamlit as st
|
3 |
import yfinance as yf
|
4 |
|
5 |
-
menu=['Home','Sport news','Crypto']
|
6 |
ch=st.sidebar.selectbox('Menu',menu)
|
7 |
if ch=='Home':
|
8 |
st.title('Test python projects')
|
@@ -22,13 +22,31 @@ if ch== 'Sport news':
|
|
22 |
if ch== 'Crypto':
|
23 |
list_asset = ['BTC-USD', 'ETH-USD', 'DOGE-USD']
|
24 |
ms = st.multiselect('choose asset', list_asset)
|
25 |
-
#ss = st.selectbox('choose asset', list_asset)
|
26 |
dates1 = st.date_input('from')
|
27 |
dates2 = st.date_input('to')
|
28 |
|
29 |
if len(ms) > 0:
|
30 |
df = yf.download(ms, dates1, dates2)
|
31 |
st.write(df)
|
32 |
-
#st.table(df)
|
33 |
df2 = yf.download(ms, dates1, dates2)['Close']
|
34 |
-
st.line_chart(df2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
import streamlit as st
|
3 |
import yfinance as yf
|
4 |
|
5 |
+
menu=['Home','Sport news','Crypto','Sales']
|
6 |
ch=st.sidebar.selectbox('Menu',menu)
|
7 |
if ch=='Home':
|
8 |
st.title('Test python projects')
|
|
|
22 |
if ch== 'Crypto':
|
23 |
list_asset = ['BTC-USD', 'ETH-USD', 'DOGE-USD']
|
24 |
ms = st.multiselect('choose asset', list_asset)
|
|
|
25 |
dates1 = st.date_input('from')
|
26 |
dates2 = st.date_input('to')
|
27 |
|
28 |
if len(ms) > 0:
|
29 |
df = yf.download(ms, dates1, dates2)
|
30 |
st.write(df)
|
|
|
31 |
df2 = yf.download(ms, dates1, dates2)['Close']
|
32 |
+
st.line_chart(df2)
|
33 |
+
|
34 |
+
if ch == 'Sales':
|
35 |
+
st.title('Good deals from stores below:')
|
36 |
+
url = requests.get('https://www.cheapshark.com/api/1.0/stores')
|
37 |
+
x = url.json()
|
38 |
+
|
39 |
+
for i in x:
|
40 |
+
st.write(i['storeName'] )
|
41 |
+
|
42 |
+
url2 = requests.get('https://www.cheapshark.com/api/1.0/deals?storeID=1&upperPrice=15')
|
43 |
+
y = url2.json()
|
44 |
+
|
45 |
+
for j in y:
|
46 |
+
st.write('------------------------------------------')
|
47 |
+
st.write('Game name: '+j['title'])
|
48 |
+
st.write('ID: '+j['gameID'])
|
49 |
+
st.write('New price: '+j['salePrice'])
|
50 |
+
st.write('Old price: '+j['normalPrice'])
|
51 |
+
st.write(j['thumb'])
|
52 |
+
st.write('------------------------------------------')
|