title: return NOT NULL columns from class with sqlalchemy
body: <p>In python <a href="http://www.sqlalchemy.org/" rel="nofollow">sqlalchemy</a> I would like to get the <code>nullable=False</code> columns of my 
  class, including JSONB types.</p>
  
  <p>Here's my example class:</p>
  
  <pre><code>class MyClass():
      __tablename__ = 'myclass'
      id = Column("id", primary_key=True)
      name = Column(String, nullable=False)
      body = Column(JSONB, nullable=False)
      irrelevant = Column(String, nullable=True)
  </code></pre>
  
  <p>Using the module <a href="https://docs.python.org/2/library/inspect.html" rel="nofollow"><code>inspect</code></a> I can get the members of <code>MyClass</code> and apply a filter:</p>
  
  <pre><code># list of possible attributes
  attr = [a for a in inspect.getmembers(MyClass,lambda :not(inspect.isroutine(a))) if not '__' in  a[0]]
  </code></pre>
  
  <p>But it is not possible to check if <code>nullable=False</code> is in a column.
  Eventually I want to get the columns: <code>name</code> and <code>body</code>.</p>