What are the all arguments for dcc.send_data_frame()

Hi all,

The documentation for dcc.Download provides some examples. There, I saw this “return dcc.send_data_frame(df.to_excel, “mydf.xlsx”, sheet_name=“Sheet_name_1”)”. My question: Where do I find info about the all arguments that can go with dcc.send_data_frame()? I didn’t find anything in the documentation.

Thanks in advance!

You can find this information in the doc string,

...
def send_data_frame(writer, filename, type=None, **kwargs):
    """
    Convert data frame into the format expected by the Download component.
    :param writer: a data frame writer
    :param filename: the name of the file
    :param type: type of the file (optional, passed to Blob in the javascript layer)
    :return: dict of data frame content (base64 encoded) and meta data used by the Download component
...

Any argument(s) beyond what is mentioned here are routed directly to the writer. Hence, in your example sheet_name will be passed to the to_excel function when it is called.

1 Like

So, in other words, the documentation doesn’t show all the info for the function. Thus, I also need to check the doc strings to better understand the functions. Agree?