title: Insert SQLalchemy from dictionary
body: <p>I have a dictionary in which the key names are the same as the column names of the sqlalchemy table/class which is called class.</p>
  
  <p>Thus I figured I could simply use the below code in order update the SQLalchemy class and then insert the newly updated data into the SQL table.</p>
  
  <pre><code>for key, value in d.items():
      setattr(Series, key, value)
  
  session.add(Series)
  session.commit()
  </code></pre>
  
  <p>However, this doesn't work because "Series" is a class. So I wondered what the most effective is to convert a dictionary into sqlalchemy class and then insert into the database.</p>
  
  <p>I prefer that the method will go through each individual key in the dictionary and then update the sql-alchemy class as there sometimes are missing key values in which the Null value should be inserted into the database.</p>