hey all - wanted to share a lib (though currently ...
# show-and-tell
z
hey all - wanted to share a lib (though currently still in alpha) I just released called pydapper. It is inspired by the NuGet lib dapper and its intent is to be a simple object mapper that sits on top of the dbapi 2.0 interface. Would love some feedback! https://pydapper.readthedocs.io/en/latest/
🚀 4
was inspired because i was tired of writing code that looks like the below in prefect tasks as well as other projects
Copy code
from psycopg2 import connect

with connect("<postgresql://pydapper:pydapper@localhost/pydapper>") as conn:
    with conn.cursor() as cursor:
        cursor.execute("select * from task")
        headers = [i[0] for i in cursor.description]
        data = cursor.fetchall()

list_data = [dict(zip(headers, row)) for row in data]
a
thanks for sharing, it looks quite interesting!