f64
commited on
Commit
·
3dd6bc7
1
Parent(s):
751af00
- app.py +4 -3
- my_static_methods.py +8 -0
- pages/3_Загрузка CSV.py +3 -2
- pages/4_просмотр_CSV.py +2 -3
- pages/6_Plotly.py +4 -3
- pages/8_Chat.py +2 -3
- pages/9_Таблица_результатов.py +3 -4
app.py
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
import streamlit as st, pandas as pd, numpy as np
|
| 2 |
|
| 3 |
st.set_page_config(layout="wide", page_title="Предсказание V", page_icon="🦋") # set_page_config() can only be called once per app page, and must be called as the first Streamlit command in your script.
|
| 4 |
-
st.sidebar.markdown("# Стартовая страница 💎")
|
| 5 |
-
# remove decoration and popup menu button at top
|
| 6 |
-
st.markdown("<style> header[data-testid='stHeader'] { display:none } div[data-testid='stAppViewBlockContainer'] { padding:1em } </style>", unsafe_allow_html=True)
|
| 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
|
| 9 |
df = pd.DataFrame([
|
| 10 |
{"command": "st.selectbox", "rating": 4, "is_widget": True},
|
|
|
|
| 1 |
import streamlit as st, pandas as pd, numpy as np
|
| 2 |
|
| 3 |
st.set_page_config(layout="wide", page_title="Предсказание V", page_icon="🦋") # set_page_config() can only be called once per app page, and must be called as the first Streamlit command in your script.
|
|
|
|
|
|
|
|
|
|
| 4 |
|
| 5 |
+
import my_static_methods as my_stm
|
| 6 |
+
st.markdown(my_stm.STYLE_CORRECTION, unsafe_allow_html=True)
|
| 7 |
+
|
| 8 |
+
st.sidebar.markdown("# Стартовая страница 💎")
|
| 9 |
|
| 10 |
df = pd.DataFrame([
|
| 11 |
{"command": "st.selectbox", "rating": 4, "is_widget": True},
|
my_static_methods.py
CHANGED
|
@@ -3,6 +3,14 @@ import pandas as pd, numpy as np
|
|
| 3 |
import plotly.express as px
|
| 4 |
import huggingface_hub
|
| 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
def df_random_dataframe() -> pd.DataFrame:
|
| 8 |
n_cols = 15
|
|
|
|
| 3 |
import plotly.express as px
|
| 4 |
import huggingface_hub
|
| 5 |
|
| 6 |
+
### remove decoration and popup menu button at top
|
| 7 |
+
STYLE_CORRECTION = " ".join([
|
| 8 |
+
"<style>",
|
| 9 |
+
"header[data-testid='stHeader'] { display:none }",
|
| 10 |
+
"div[data-testid='stAppViewBlockContainer'] { padding:1em }",
|
| 11 |
+
"div[data-testid='collapsedControl'] { background-color:#FFF }",
|
| 12 |
+
"</style>"
|
| 13 |
+
])
|
| 14 |
|
| 15 |
def df_random_dataframe() -> pd.DataFrame:
|
| 16 |
n_cols = 15
|
pages/3_Загрузка CSV.py
CHANGED
|
@@ -1,8 +1,9 @@
|
|
| 1 |
import os, csv, json
|
| 2 |
import streamlit as st, pandas as pd, numpy as np
|
|
|
|
|
|
|
|
|
|
| 3 |
st.sidebar.markdown("## загрузка 💾")
|
| 4 |
-
# remove decoration and popup menu button at top
|
| 5 |
-
st.markdown("<style> header[data-testid='stHeader'] { display:none } div[data-testid='stAppViewBlockContainer'] { padding:1em } div[data-testid='collapsedControl'] { background-color:#FFF } </style>", unsafe_allow_html=True)
|
| 6 |
|
| 7 |
uploaded_file = st.file_uploader("“откройте CSV для загрузки”", ["csv"]) # или CSV.ZIP
|
| 8 |
if uploaded_file is not None:
|
|
|
|
| 1 |
import os, csv, json
|
| 2 |
import streamlit as st, pandas as pd, numpy as np
|
| 3 |
+
import my_static_methods as my_stm
|
| 4 |
+
st.markdown(my_stm.STYLE_CORRECTION, unsafe_allow_html=True)
|
| 5 |
+
|
| 6 |
st.sidebar.markdown("## загрузка 💾")
|
|
|
|
|
|
|
| 7 |
|
| 8 |
uploaded_file = st.file_uploader("“откройте CSV для загрузки”", ["csv"]) # или CSV.ZIP
|
| 9 |
if uploaded_file is not None:
|
pages/4_просмотр_CSV.py
CHANGED
|
@@ -1,12 +1,11 @@
|
|
| 1 |
import os
|
| 2 |
import streamlit as st, pandas as pd, numpy as np
|
| 3 |
import my_static_methods as my_stm
|
|
|
|
| 4 |
|
| 5 |
#st.sidebar.title("⚜️")
|
| 6 |
#st.sidebar.info("три CSV")
|
| 7 |
-
st.sidebar.markdown("
|
| 8 |
-
# remove decoration and popup menu button at top
|
| 9 |
-
st.markdown("<style> header[data-testid='stHeader'] { display:none } div[data-testid='stAppViewBlockContainer'] { padding:1em } div[data-testid='collapsedControl'] { background-color:#FFF } </style>", unsafe_allow_html=True)
|
| 10 |
|
| 11 |
#col1.metric("Temperature", "70 °F", "1.2 °F") #col2.metric("Wind", "9 mph", "-8%") #col3.metric("Humidity", "86%", "4%")
|
| 12 |
|
|
|
|
| 1 |
import os
|
| 2 |
import streamlit as st, pandas as pd, numpy as np
|
| 3 |
import my_static_methods as my_stm
|
| 4 |
+
st.markdown(my_stm.STYLE_CORRECTION, unsafe_allow_html=True)
|
| 5 |
|
| 6 |
#st.sidebar.title("⚜️")
|
| 7 |
#st.sidebar.info("три CSV")
|
| 8 |
+
st.sidebar.markdown("***\n сохраненные \n таблицы \n CSV 💽 \n***")
|
|
|
|
|
|
|
| 9 |
|
| 10 |
#col1.metric("Temperature", "70 °F", "1.2 °F") #col2.metric("Wind", "9 mph", "-8%") #col3.metric("Humidity", "86%", "4%")
|
| 11 |
|
pages/6_Plotly.py
CHANGED
|
@@ -1,7 +1,8 @@
|
|
| 1 |
import streamlit as st, pandas as pd, numpy as np
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
|
|
|
| 5 |
|
| 6 |
import plotly.figure_factory as ff
|
| 7 |
import plotly.graph_objs as go
|
|
|
|
| 1 |
import streamlit as st, pandas as pd, numpy as np
|
| 2 |
+
import my_static_methods as my_stm
|
| 3 |
+
st.markdown(my_stm.STYLE_CORRECTION, unsafe_allow_html=True)
|
| 4 |
+
|
| 5 |
+
st.sidebar.markdown("# ПРИМЕР : интерактивные графики на Plotly 📊")
|
| 6 |
|
| 7 |
import plotly.figure_factory as ff
|
| 8 |
import plotly.graph_objs as go
|
pages/8_Chat.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
| 1 |
import streamlit as st, pandas as pd, numpy as np
|
|
|
|
|
|
|
| 2 |
st.sidebar.markdown("# Переговоры 💬")
|
| 3 |
-
# remove decoration and popup menu button at top
|
| 4 |
-
st.markdown("<style> header[data-testid='stHeader'] { display:none } div[data-testid='stAppViewBlockContainer'] { padding:1em } </style>", unsafe_allow_html=True)
|
| 5 |
-
|
| 6 |
|
| 7 |
# with st.sidebar:
|
| 8 |
messages = st.container() # height=300
|
|
|
|
| 1 |
import streamlit as st, pandas as pd, numpy as np
|
| 2 |
+
import my_static_methods as my_stm
|
| 3 |
+
st.markdown(my_stm.STYLE_CORRECTION, unsafe_allow_html=True)
|
| 4 |
st.sidebar.markdown("# Переговоры 💬")
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# with st.sidebar:
|
| 7 |
messages = st.container() # height=300
|
pages/9_Таблица_результатов.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import streamlit as st, pandas as pd, numpy as np
|
| 2 |
-
st.sidebar.markdown("# таблица не интерактивная ❄️")
|
| 3 |
-
# remove decoration and popup menu button at top
|
| 4 |
-
st.markdown("<style> header[data-testid='stHeader'] { display:none } div[data-testid='stAppViewBlockContainer'] { padding:1em } </style>", unsafe_allow_html=True)
|
| 5 |
import my_static_methods as my_stm
|
| 6 |
-
|
|
|
|
|
|
|
| 7 |
st.dataframe(my_stm.random_dataframe())
|
|
|
|
| 1 |
import streamlit as st, pandas as pd, numpy as np
|
|
|
|
|
|
|
|
|
|
| 2 |
import my_static_methods as my_stm
|
| 3 |
+
st.markdown(my_stm.STYLE_CORRECTION, unsafe_allow_html=True)
|
| 4 |
+
|
| 5 |
+
st.sidebar.markdown("### просто таблица случайных чисел - пока заглушка ❄️")
|
| 6 |
st.dataframe(my_stm.random_dataframe())
|