CCockrum commited on
Commit
79d8dc9
Β·
verified Β·
1 Parent(s): 835341f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -117,6 +117,8 @@ search_query = collections[selected]
117
  # Define the collection URL
118
  collection_url = f"https://www.loc.gov/search/?q={search_query}&fo=json"
119
 
 
 
120
 
121
  # Helpful Resources (styled and moved below dropdown)
122
  st.sidebar.markdown("### Helpful Resources", unsafe_allow_html=True)
@@ -209,9 +211,10 @@ if fetch_data:
209
  # Show summary statistics in sidebar
210
  # βœ… Quick Stats (after metadata_df is created and populated)
211
  if not metadata_df.empty:
212
- st.sidebar.markdown("<h3 class='sidebar-stats'>πŸ“Š Quick Stats</h3>", unsafe_allow_html=True)
213
- st.sidebar.markdown(f"<p style='color:lightgray;'>Total Records: <b>{len(metadata_df)}</b></p>", unsafe_allow_html=True)
214
- st.sidebar.markdown(f"<p style='color:lightgray;'>Incomplete Records: <b>{len(metadata_df[metadata_df.isnull().any(axis=1)])}</b></p>", unsafe_allow_html=True)
 
215
 
216
  st.sidebar.write(f"Incomplete Records: {len(metadata_df[metadata_df.isnull().any(axis=1)])}")
217
 
 
117
  # Define the collection URL
118
  collection_url = f"https://www.loc.gov/search/?q={search_query}&fo=json"
119
 
120
+ # Create an empty placeholder for Quick Stats
121
+ stats_placeholder = st.sidebar.empty()
122
 
123
  # Helpful Resources (styled and moved below dropdown)
124
  st.sidebar.markdown("### Helpful Resources", unsafe_allow_html=True)
 
211
  # Show summary statistics in sidebar
212
  # βœ… Quick Stats (after metadata_df is created and populated)
213
  if not metadata_df.empty:
214
+ stats_placeholder.markdown("<h3 class='sidebar-stats'>πŸ“Š Quick Stats</h3>", unsafe_allow_html=True)
215
+ stats_placeholder.markdown(f"<p style='color:lightgray;'>Total Records: <b>{len(metadata_df)}</b></p>", unsafe_allow_html=True)
216
+ stats_placeholder.markdown(f"<p style='color:lightgray;'>Incomplete Records: <b>{len(metadata_df[metadata_df.isnull().any(axis=1)])}</b></p>", unsafe_allow_html=True)
217
+
218
 
219
  st.sidebar.write(f"Incomplete Records: {len(metadata_df[metadata_df.isnull().any(axis=1)])}")
220