Download data frame from DASH App

saved…alot of time.

Great! I have improved the syntax slight in version 0.0.18, now additional arguments are passed directly to the writer, i.e. the previous code can now be written as,

return send_data_frame(df.to_csv, report_name, index=False)

Hi @MishD, I’m trying to use the send_data_frame() to dowload the dataframe, but I don´t know why is not working.

@app.callback(Output("download", "data"), [Input("btn", "n_clicks")], [State('alocacao_tb', 'data'),])
def func(n_nlicks, dataset):
    df = pd.DataFrame(dataset)
    print(df)
    return send_data_frame(df.to_excel, "mydf.xls")

this is my code.
When I click in dowload the print(df) is working but nothing happens with the file.

could you help me ?

I got the impor t error for Download, then installed dash_extensions 0.0.16.
Now, I get

ModuleNotFoundError: No module named ‘dash_extensions.enrich’

The Download component has been merged into the main Dash repo as part of the dcc module,