import io
import csv


def ids_from_csv_file_str(csv_file_str, fieldnames, fieldname):
    """return a set of ids from a string that is the contents of a file string
    fieldnames is all the field names in the file
    fieldname is one of the fieldnamds that is the id"""
    infile = io.StringIO(csv_file_str)
    reader = csv.DictReader(infile, fieldnames, dialect='editor')
    ret = []
    for row in reader:
        if set(row.values()) == set(fieldnames):
            continue # first row might be the title
        ret.append(row[fieldname])
    return ret