data = {'qwe': 1, 'asd': 2, 'zxc': None}
conn = MySQLdb.connect(**params)
cursor = conn.cursor()
cursor.execute(sql, data)
cursor.close()
conn.close()
Quickest way to dump Python dictionary (dict) object to a MySQL table?