CCockrum commited on
Commit
367a3e1
Β·
verified Β·
1 Parent(s): e5ec22d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -4
app.py CHANGED
@@ -104,7 +104,7 @@ metadata_df = pd.DataFrame()
104
 
105
  # Display Summary Statistics if available
106
  if 'metadata_df' in locals() and not metadata_df.empty:
107
- st.sidebar.markdown("### πŸ“Š Quick Stats")
108
  st.sidebar.write(f"Total Records: {len(metadata_df)}")
109
  st.sidebar.write(f"Incomplete Records: {len(metadata_df[metadata_df.isnull().any(axis=1)])}")
110
 
@@ -116,9 +116,9 @@ search_query = collections[selected]
116
  collection_url = f"https://www.loc.gov/search/?q={search_query}&fo=json"
117
 
118
 
119
- # πŸ”— Helpful Resources (styled and moved below dropdown)
120
- st.sidebar.markdown("### πŸ”— Helpful Resources", unsafe_allow_html=True)
121
- # πŸ”— Helpful Resources styled section
122
  st.sidebar.markdown("""
123
  <style>
124
  .sidebar-section h3 {
@@ -204,6 +204,12 @@ if fetch_data:
204
 
205
  metadata_df = pd.DataFrame(items)
206
 
 
 
 
 
 
 
207
  # Utility functions for deeper metadata quality analysis
208
  def is_incomplete(value):
209
  return pd.isna(value) or value in ["", "N/A", "null", None]
 
104
 
105
  # Display Summary Statistics if available
106
  if 'metadata_df' in locals() and not metadata_df.empty:
107
+ st.sidebar.markdown("### Quick Stats")
108
  st.sidebar.write(f"Total Records: {len(metadata_df)}")
109
  st.sidebar.write(f"Incomplete Records: {len(metadata_df[metadata_df.isnull().any(axis=1)])}")
110
 
 
116
  collection_url = f"https://www.loc.gov/search/?q={search_query}&fo=json"
117
 
118
 
119
+ # Helpful Resources (styled and moved below dropdown)
120
+ st.sidebar.markdown("### Helpful Resources", unsafe_allow_html=True)
121
+ # Helpful Resources styled section
122
  st.sidebar.markdown("""
123
  <style>
124
  .sidebar-section h3 {
 
204
 
205
  metadata_df = pd.DataFrame(items)
206
 
207
+ # Show summary statistics in sidebar
208
+ if not metadata_df.empty:
209
+ st.sidebar.markdown("### πŸ“Š Quick Stats")
210
+ st.sidebar.write(f"Total Records: {len(metadata_df)}")
211
+ st.sidebar.write(f"Incomplete Records: {len(metadata_df[metadata_df.isnull().any(axis=1)])}")
212
+
213
  # Utility functions for deeper metadata quality analysis
214
  def is_incomplete(value):
215
  return pd.isna(value) or value in ["", "N/A", "null", None]