Skip to content

Commit

Permalink
feat: enhance metadata retrieval process with progress indicators
Browse files Browse the repository at this point in the history
  • Loading branch information
Ovler-Young committed Nov 19, 2024
1 parent c4573cf commit 0b3ec7e
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/ia_collection_analyzer/streamlit.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,18 @@
st.stop()

# display we're getting the metadata
st.write("Getting metadata for collection:", collection_id)

# display the ids
progress_text = st.text(f"Getting metadata for collection: {collection_id}, please wait...")
progress_bar = st.progress(0)
items = get_collection_items_metadata(collection_id)
progress_text.text(f"Getting metadata for collection: {collection_id}, transforming data...")
progress_bar.progress(95)
items_pd = pd.DataFrame(items)
progress_text.text(f"Getting metadata for collection: {collection_id}, cleaning data...")
# drop columns with 80%+ nan
items_pd = items_pd.dropna(axis=1, thresh=0.8 * len(items_pd))
progress_text.text(f"Getting metadata for collection: {collection_id}, done!")

progress_bar.progress(100)

st.write("The collection contains the following items:")
st.write(items_pd)

0 comments on commit 0b3ec7e

Please sign in to comment.