Copy dataframe to clipboard

Is it possible to copy the data displayed by st.dataframe to the clipboard? The current implementation allows a partial copy paste for single column dataframes, but doesn’t work at all for multi column.


Hi @kierancondon, welcome to the Streamlit community!

Can you be more specific of the behavior you are desiring? For a multi-column dataframe, is your desire to be able to still highlight just a single column?


Hi Randy,

There is no need to select individual columns. The users would just like to be able to select the whole dataframe including the row index, headers and data and copy it all into clipboard, so as to paste it to Excel. The same result as if someone could run “df.to_clipboard()”.

I don’t know why it works better on the dfs in your help documentation than in my app. I can’t even select the index from a dataframe in the app. Nevertheless, even with the dfs in the help documentation, pasting the values in excel gives something very difficult to work with.

Copy/Paste does work well for “st.table”, yet for any dataframe larger than screen size, table is not the right choice.

I believe this development is important because streamlit does not yet offer ways for the user to pull data from the app.

Thank you,