holoviz / panel

Panel: The powerful data exploration & web app framework for Python
https://panel.holoviz.org
BSD 3-Clause "New" or "Revised" License
4.62k stars 500 forks source link

Easy to Use Download DataFrame Button #2342

Open MarcSkovMadsen opened 3 years ago

MarcSkovMadsen commented 3 years ago

One of the things that in my experience is always needed is an easy way to upload and download data to a dataframe. I would like this to be super, super easy.

download = pn.widgets.DownloadButton(name="Download", value=df, options=["csv", "xlsx", "parquet"])

If multiple options are provided the button should be a SplitButton similar to Bootstrap Split Button. The dropdown is for selecting which of the options to download.

image

The notebook https://github.com/holoviz/panel/blob/master/examples/gallery/simple/file_download_examples.ipynb provides the code to convert a dataframe to the respective file types.

jbednar commented 3 years ago

See https://github.com/holoviz/param/pull/482 , which might be relevant as part of a solution.