import sqlite3


def get_categories(table="iherb", db_name="databases/items.db"):
    """
    Lightweight function to extract only the unique super-categories

    :param table: Table to read from
    :param db_name: The path to the SQLite file
    :return:
    """

    query = "SELECT DISTINCT category FROM {}".format(table)

    con = sqlite3.connect(db_name)
    cur = con.cursor()
    items = list(set([item[0].split(",")[0] for item in cur.execute(query).fetchall()]))
    con.close()

    return items