Add button to download the source code

Hi! I’m developing a web app with streamlit that reads a CSV, Excel or JSON file and make some visualization with Plotly based on user input.

My question is; is there any way to add a streamlit button that can download the source code of the charts created? To explain more, the user uploads a data file then clicks on an Add Chart button to open a select box to choose a specific column and another select box for a chart (pie, bar, line e.g.). Now, after this step, I want to allow the user to download the source code of the charts created to use them later in their project or custom the chart itself with advanced features.

Can you help me, please?

1 Like