Spaces:
Running
Running
Update app.py
Browse files
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 |
-
#
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
st.sidebar.markdown("## Settings")
|
18 |
-
st.sidebar.
|
|
|
|
|
|
|
|
|
|
|
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)
|