example-app-csv-wrangler icon indicating copy to clipboard operation
example-app-csv-wrangler copied to clipboard

added the download to xslx feature + button

Open alicecommits opened this issue 2 years ago • 1 comments

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 avatar Jun 28 '23 18:06 alicecommits

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).

alicecommits avatar Jun 28 '23 19:06 alicecommits