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

added the download to xslx feature + button #6

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alicecommits
Copy link

@alicecommits alicecommits commented Jun 28, 2023

Hi,
I wanted to add the capability for the button to write the wrangled dataframe into .xlsx format.
For this, I added a parameter target_format that accepts txt, csv, or xlsx, and download_button function processes the csv accordingly.
For now, I haven't handled the case where the user does not specify the format, if it has to materialize into an error or select a certain default format option (like csv).
Using BytesIO lib, I stored the processed data in an _io.BytesIO object, then converted to bytes object, following this stack overflow thread

@alicecommits
Copy link
Author

alicecommits commented Jun 28, 2023

Note: my PR also contains the modif label=" " and label_visibility='collapsed' , otherwise my st.file_uploader() function in app.py was running into the label value error (see this issue).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant