metadata = MetaData(engine)
t = Table('t', metadata, Column('id', Integer, primary_key=True), Column(
    'number', Integer))
t.create()
engine.execute(t.insert().values(id=1, number=3))
engine.execute(t.insert().values(id=9, number=-3))
createview = CreateView('viewname', t.select().where(t.c.id > 5))
engine.execute(createview)
v = Table('viewname', metadata, autoload=True)
for r in engine.execute(v.select()):
    pass
How to create an SQL View with SQLAlchemy?