title: Given a declarative SQLAlchemy class, how can I programmatically retrieve a list of its Column objects that are primary keys?
body: <p>Say I have a class in SQLAlchemy like</p>
  
  <pre><code>class Note(Base):
      __tablename__ = 'notes'
      slug = Column('short_title', String, primary_key=True)
      date = Column('day', Date, primary_key=True)
      contents = Column(Text, nullable=True)
  </code></pre>
  
  <p>Given only a reference to the Note class, how could a function build the list ['Note.slug', 'Note.date'] predicated on their constituting the corresponding table's primary key?</p>
  
  <p>Furthermore, is there a way to filter class attributes based on column properties? (such as nullable, type, uniqueness, membership in an index, etc)</p>