title: How to get all the column names & their types, including ENUM (and it's possible values)
body: <p>I wrote the following code to get all the columns names and types in sqlalchemy. However, in case of ENUM type I am getting Varchar instead. </p>
  
  <p>I want to know a way using which I can get enum type for all the enum columns and all the possible values of enum as well.</p>
  
  <pre><code>EntityClass = eval(entity_name)
  entity_dict = {}
  entity_dict['attributes'] = []
  for column in EntityClass.__table__.columns:
      entity_dict['attributes'].append({
          'key': str(column.key),
          'type': str(column.type).split('(')[0].split('[')[0]
      })
  print entity_dict
  </code></pre>
  
  <p>I am using the following method to create a new Enum in sqlalchemy:</p>
  
  <pre><code>class CourseType(enum.Enum):
      Certified = "Certified"
      Non_Certified = "Non_Certified"
  
      @staticmethod
      def list():
          return list(map(lambda c: c.value, CourseType))
  </code></pre>
  
  <p>And this is how I am using the enum in a table:</p>
  
  <pre><code>type = Column(Enum(CourseType))
  </code></pre>
  
  <p>Any suggestions?</p>