def dict_to_hstore(python_dict):
    
    hstore = StringIO()
    
    first_row = True
    for key in python_dict:
        if not first_row:
            hstore.write(",")
        else:
            first_row=False
        hstore.write("\"%s\"=>\"%s\"" % (key, python_dict[key]))
    return hstore.getvalue()
Assume it's a '1-dimensional' hash--that is, just a list of key values where everything is quoted.
dataset/ETHPy150Open sunlightlabs/read_FEC/fecreader/formdata/utils/hstore_helpers.py/dict_to_hstore