def printSchema(connection):
    for tableName, in connection.execute(
        """
        select NAME from SQLITE_MASTER where TYPE='table' order by NAME;
        """
        ):
        print('{}:'.format(tableName))
for columnID, columnName, columnType, columnNotNull, columnDefault, columnPK in connection.execute(
    "pragma table_info('{}');".format(tableName)):
    pass
Is there a way to get a schema of a database from within python?