Spaces:
Running
Running
Ludwig Stumpp
commited on
Commit
·
3be1fea
1
Parent(s):
bfa63f2
Add sources
Browse files- streamlit_app.py +18 -0
streamlit_app.py
CHANGED
@@ -100,6 +100,23 @@ def setup_benchmarks():
|
|
100 |
st.markdown("\n".join(text))
|
101 |
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
103 |
def setup_footer():
|
104 |
st.markdown(
|
105 |
"""
|
@@ -113,6 +130,7 @@ def main():
|
|
113 |
setup_basic()
|
114 |
setup_table()
|
115 |
setup_benchmarks()
|
|
|
116 |
setup_footer()
|
117 |
|
118 |
|
|
|
100 |
st.markdown("\n".join(text))
|
101 |
|
102 |
|
103 |
+
def setup_sources():
|
104 |
+
csv_table = grab_file_from_repo(REPO_URL, "sources.csv")
|
105 |
+
df = pd.read_csv(io.StringIO(csv_table), index_col=0)
|
106 |
+
df = df.sort_index(ascending=True)
|
107 |
+
|
108 |
+
st.markdown("### Sources")
|
109 |
+
|
110 |
+
selected_source = st.selectbox("Select a source to learn more:", df.index.unique())
|
111 |
+
df_selected = df.loc[selected_source]
|
112 |
+
text = [
|
113 |
+
f"Author: {selected_source} ",
|
114 |
+
]
|
115 |
+
for key in df_selected.keys():
|
116 |
+
text.append(f"{key}: {df_selected[key]} ")
|
117 |
+
st.markdown("\n".join(text))
|
118 |
+
|
119 |
+
|
120 |
def setup_footer():
|
121 |
st.markdown(
|
122 |
"""
|
|
|
130 |
setup_basic()
|
131 |
setup_table()
|
132 |
setup_benchmarks()
|
133 |
+
setup_sources()
|
134 |
setup_footer()
|
135 |
|
136 |
|