Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding button to download dataset as CSV #184

Merged
merged 2 commits into from
Oct 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions labs/TrapheusAI/trapheusai_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ def handle_dataset_search():
repository_url = data["fullurl"]
df = pd.read_csv(repository_url)
streamlit.data_editor(df)
streamlit.download_button(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we check if we edit the dataset and then download are the changes retained?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't retain the changes but we can modify this to retain the changes if required.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging this, can you open a new issue and work on saving the in memory CSV file

"Download as CSV", data = df.to_csv(index=False), file_name=f"{choice}.csv",
mime = "text/csv", on_click = showDownloadMessage)
question = streamlit.chat_input("Ask any question related to the dataset")
if question:

Expand Down Expand Up @@ -98,6 +101,9 @@ def style_page():
"""
streamlit.markdown(style, unsafe_allow_html=True)

def showDownloadMessage():
streamlit.success("Your dataset has been saved")


if __name__ == "__main__":
initialize_page()
Expand Down