for columnID, columnName, columnType, columnNotNull, columnDefault, columnPK in connection.execute(
    "pragma table_info('{}');".format(tableName)):
    print('  {id}: {name}({type}){null}{default}{pk}'.format(id=columnID,
        name=columnName, type=columnType, null=' not null' if columnNotNull
         else '', default=' [{}]'.format(columnDefault) if columnDefault else
        '', pk=' *{}'.format(columnPK) if columnPK else ''))
Is there a way to get a schema of a database from within python?