title: Recreate some sqlalchemy object
body: <p>Ok, so I'm having a bit of a problem here. I need to be able to create a sort of import/export functionality for some sqlalchemy. Now these are not objects I'm defining, so to get the columns I'm doing:</p>
  
  <pre><code>for attr, value in res.__class__.__dict__.iteritems():
       if isinstance(value, InstrumentedAttribute):
            data = eval("res." + str(attr))
            param_dict[attr] = data
  </code></pre>
  
  <p>Now this correctly gets me the attributes of that object. However, I can;t be certain that the parameters of the <strong>init</strong> are the same, since I'm not the one handling this objects. So there could be a situation like:</p>
  
  <pre><code>class SomeClass(model.Base):
      my_column = Column(String)
      ....some other stuff...
  
      def __init__(self, mycolumn, ...):
             self.my_column = mycolumn
  </code></pre>
  
  <p>So in this case I don't have any correspondance between the name of the field and the name of the parameter as recieved by init. I'm currently contraining the ones who define these classes to have all the init parametes with a default value so I could just:</p>
  
  <pre><code>obj = SomeClass()
  exec "obj." + attr + " = " + param[attr]
  </code></pre>
  
  <p>However I would like to get away even from this constrain. Is there any way I can achieve this? </p>