-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopportunities_dashboard.py
More file actions
79 lines (56 loc) · 1.94 KB
/
opportunities_dashboard.py
File metadata and controls
79 lines (56 loc) · 1.94 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
import streamlit as st
import pandas as pd
# things to be cached
#@st.cache_resource
#######
# Read in the csv file that I want to work with in this app
raw_data = pd.read_csv('data/ContractOpp_data/filtered_and_summarized_data/filtered_data_04May.csv', encoding='utf-8')
st.set_page_config(layout='wide')
# I want to try to create a page where opportunities can be viewed at a very brief/summary glance,
# while then allowing to expand on each further if a person wants to.
with st.sidebar:
st.title("Filters")
# Department filter
st.subheader('Department')
selected_depts = st.multiselect(
'Select departments:',
options = raw_data['Sub-Tier'].unique(),
default=None
)
st.divider()
# Type of opportunity filter
# (so RFI, solicitation,...)
st.subheader('Opportunity Type')
selected_type = st.multiselect(
'Select Type:',
options= raw_data['Type'].unique(),
default=None
)
st.divider()
# Columns selector
st.subheader("Layout")
num_columns = st.radio(
"Cards per row:",
options=[2,3,4],
index=1,
label_visibility='collapsed'
)
filtered_df = raw_data[
(raw_data['Sub-Tier'].isin(selected_depts) &
raw_data['Type'].isin(selected_type))
]
# Main content
st.title("Opportunities Dashboard")
st.title(f'{len(filtered_df)} opportunities found')
cols = st.columns(num_columns)
for idx, row in filtered_df.iterrows():
with cols[idx % num_columns]:
with st.container(border=True):
st.subheader(row['Title'])
st.write("Summary:", row['ai_summary_description'])
st.write(row['Sub-Tier'])
st.write("Posted Date:", row['PostedDate'])
st.write("Response Deadline:", row['ResponseDeadLine'])
with st.expander("More Details"):
st.write('Solicitation Number: ', row['Sol#'])
st.write("Link:", row['Link'])