def count_flowables_by_class(flowlist):
    """
    Counts flowables by class
    :param flowlist: A FlowList in standard format
    :return: pandas df with 'Class' and counts of unique flowables
    """
    flowables_by_class = flowlist[['Class', 'Flowable']]
    flowables_by_class = flowables_by_class.drop_duplicates()
    flowables_by_class_count = flowables_by_class.groupby('Class')['Flowable'].count().reset_index()
    total = flowables_by_class_count['Flowable'].sum()
    flowables_by_class_count['Percent'] = flowables_by_class_count['Flowable'].apply(
        lambda x: str((x / total) * 100) + '%')
    total_row = {'Class': 'TOTAL', 'Flowable': total}
    flowables_by_class_count = flowables_by_class_count.append(total_row, ignore_index=True)
    return flowables_by_class_count