Inspecting Postgres column types with SqlAlchemy

SQL Alchemy makes it easy to get types out of the database: from sqlalchemy import * engine = create_engine( “postgresql+pg8000://postgres:postgres@localhost/postgres”, isolation_level=”READ UNCOMMITTED” ) c = engine.connect() meta = MetaData() t = Table(‘table’, meta, autoload=True, autoload_with=engine, schema=’test’) columns = [col for col in t.columns] And then from there, you can filter the column list down to …