Spaces:
Runtime error
Runtime error
natexcvi
commited on
Commit
•
3635740
1
Parent(s):
69cd8ff
Fix tz
Browse files- app.py +3 -2
- requirements.txt +2 -1
app.py
CHANGED
@@ -4,6 +4,7 @@ from datetime import tzinfo
|
|
4 |
|
5 |
import pandas as pd
|
6 |
import streamlit as st
|
|
|
7 |
|
8 |
from api import TradeAssistantAPI
|
9 |
from style import recommendation_table_styler
|
@@ -30,8 +31,8 @@ try:
|
|
30 |
recommendations = json.loads(recommendation_res["recommendations"])
|
31 |
recommendations = pd.DataFrame(recommendations)
|
32 |
st.dataframe(recommendations.style.pipe(recommendation_table_styler))
|
33 |
-
tz =
|
34 |
-
updated_time_ago = pd.Timestamp.now().tz_localize(
|
35 |
updated, tz="UTC"
|
36 |
)
|
37 |
st.write(f"Updated: {updated_time_ago} ago")
|
|
|
4 |
|
5 |
import pandas as pd
|
6 |
import streamlit as st
|
7 |
+
from tzlocal import get_localzone
|
8 |
|
9 |
from api import TradeAssistantAPI
|
10 |
from style import recommendation_table_styler
|
|
|
31 |
recommendations = json.loads(recommendation_res["recommendations"])
|
32 |
recommendations = pd.DataFrame(recommendations)
|
33 |
st.dataframe(recommendations.style.pipe(recommendation_table_styler))
|
34 |
+
tz = get_localzone()
|
35 |
+
updated_time_ago = pd.Timestamp.now().tz_localize(tz) - pd.Timestamp(
|
36 |
updated, tz="UTC"
|
37 |
)
|
38 |
st.write(f"Updated: {updated_time_ago} ago")
|
requirements.txt
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
streamlit==1.23.0
|
2 |
requests
|
3 |
pandas
|
4 |
-
matplotlib
|
|
|
|
1 |
streamlit==1.23.0
|
2 |
requests
|
3 |
pandas
|
4 |
+
matplotlib
|
5 |
+
tzlocal
|