from datetime import datetime


def get_data_for_daily_statistics_table(df):
    """
    Return data which is ready to be inserted to the daily_statistics table in 
    the database.

    Parameters
    ----------
    df : pandas.core.frame.DataFrame
        Pandas Dataframe containing data received from the API.

    Returns
    -------
    df_daily_statistics_data : pandas.core.frame.DataFrame
        Pandas Dataframe containing data to be inserted to the daily_statistics 
        table in the database.

    """
    df_daily_statistics_data = (
        df.groupby(["district_name", "min_age_limit", "vaccine"])["available_capacity"]
        .sum()
        .reset_index()
    )
    df_daily_statistics_data["vaccine"] = df_daily_statistics_data[
        "vaccine"
    ].str.upper()
    df_daily_statistics_data["timestamp"] = datetime.utcnow().strftime(
        "%Y-%m-%d %H:%M:%S"
    )
    return df_daily_statistics_data