import base64


def download_data(data):
    """
    Download data in .csv format
    Args:
        data (`pd.DataFrame`): A pandas dataframe
    Returns:
        str: A href link to be fed into the dashboard ui.
    """
    to_download = data.to_csv(index=False)
    b64 = base64.b64encode(to_download.encode()).decode()
    href = f'<a href="data:file/text;base64,{b64}">Download csv file</a>'

    return href