PyMySQL include un DictCursor
. Fa quello che penso tu voglia. Ecco come usarlo:
import pymysql
connection = pymysql.connect(db="test")
cursor = connection.cursor(pymysql.cursors.DictCursor)
cursor.execute("SELECT ...")
https://github.com/PyMySQL/PyMySQL/blob /master/pymysql/tests/test_DictCursor.py