Is there any way to get the results from a fetchall() as a dictionary using pymysql?
PyMySQL includes a DictCursor. It does what I think you want. Here's how to use it:
DictCursor
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
1.4m articles
1.4m replys
5 comments
57.0k users