title: Easy convert betwen SQLAlchemy column types and python data types?
body: <p>I'm looking for an easy python way to compare column types from SQLAlchemy to base types.  For example, if my column type is a VARCHAR of any length, I want to read it as a string.</p>
  
  <p>I can read the column type okay, but I'm not sure an easy way to verify it's basic type... it would be nice if I could use something like "if isinstance(mycolumn, int)" - but I'm new to python and not sure how this would work.</p>
  
  <p>Here's what I have so far:</p>
  
  <pre><code>from sqlalchemy import MetaData
  from sqlalchemy import create_engine, Column, Table
  engine = create_engine('mysql+mysqldb://user:pass@localhost:3306/mydb', pool_recycle=3600)
  meta = MetaData()
  meta.bind = engine
  meta.reflect()
  datatable = meta.tables['my_data_table']
  [c.type for c in datatable.columns]
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>[INTEGER(display_width=11), DATE(), VARCHAR(length=127), DOUBLE(precision=None, scale=None, asdecimal=True)]
  </code></pre>
  
  <p>My end purpose is twofold, first because I want to format the output based on the type when I load it into my jQuery jqGrid.  The second, is I'm slowly converting non-normalized data tables into a normalized structure, and want to ensure that I keep my types consistent - (to make sure my numbers in the previous table are stored as numbers and not strings...)</p>