CCockrum commited on
Commit
083533c
·
verified ·
1 Parent(s): a5c5559

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -3
app.py CHANGED
@@ -12,10 +12,22 @@ This tool connects to the LOC API, retrieves metadata from a selected collection
12
  an initial analysis of metadata completeness.
13
  """)
14
 
15
- # User selects a collection (predefined for prototype)
16
- collection_url = "https://www.loc.gov/collections/american-revolutionary-war-maps/?fo=json"
 
 
 
 
 
 
 
17
  st.sidebar.markdown("## Settings")
18
- st.sidebar.write("Collection: American Revolutionary War Maps")
 
 
 
 
 
19
 
20
  # Fetch data from LOC API
21
  response = requests.get(collection_url)
 
12
  an initial analysis of metadata completeness.
13
  """)
14
 
15
+ # Predefined LOC collections
16
+ collections = {
17
+ "American Revolutionary War Maps": "american-revolutionary-war-maps",
18
+ "Civil War Maps": "civil-war-maps",
19
+ "Women’s Suffrage": "womens-suffrage",
20
+ "World War I Posters": "world-war-i-posters"
21
+ }
22
+
23
+ # Sidebar for selecting collection
24
  st.sidebar.markdown("## Settings")
25
+ selected = st.sidebar.selectbox("Select a collection", list(collections.keys()))
26
+ collection_path = collections[selected]
27
+ collection_url = f"https://www.loc.gov/collections/{collection_path}/?fo=json"
28
+
29
+ # Display selected collection
30
+ st.sidebar.write(f"Selected Collection: {selected}")
31
 
32
  # Fetch data from LOC API
33
  response = requests.get(collection_url)