def clean_record(record: typing.Dict[(str, str)]):
    "This is a bit of a hack.  But using get_all_records doesn't leave many\n    options"
    new_record = {}
    for (k, v) in record.items():
        k = slugify.slugify(k.lower().strip())
        v = str(v)
        for (field, names) in ALIASES.items():
            new_record.setdefault(field, '')
            if (k in names):
                new_record[field] += (('. ' if new_record[field] else '') + v)
                k = None
                break
        if (k == 'amount'):
            v = v.replace(',', '')
            for s in STRIP_SYMOLS:
                v = v.replace(s, '')
            if (v and (not v[0].isdecimal()) and (not (v[0] == '-'))):
                v = v[1:]
            try:
                v = decimal.Decimal(v)
            except decimal.InvalidOperation:
                v = 0
        if k:
            new_record[k] = v
    return new_record
This is a bit of a hack.  But using get_all_records doesn't leave many
options
def clean_record(record: typing.Dict[(str, str)]):
    "This is a bit of a hack.  But using get_all_records doesn't leave many\n    options"
    new_record = {}
    for (k, v) in record.items():
        k = slugify.slugify(k.lower().strip())
        v = str(v)
        for (field, names) in ALIASES.items():
            new_record.setdefault(field, )
            if (k in names):
                new_record[field] += (('. ' if new_record[field] else ) + v)
                k = None
                break
        if (k == 'amount'):
            v = v.replace(',', )
            for s in STRIP_SYMOLS:
                v = v.replace(s, )
            if (v and (not v[0].isdecimal()) and (not (v[0] == '-'))):
                v = v[1:]
            try:
                v = decimal.Decimal(v)
            except decimal.InvalidOperation:
                v = 0
        if k:
            new_record[k] = v
    return new_record