title: Importing JSON Data to SQL using sqlalchemy python
body: <p>So I have a set of JSON files and would like to import them to my sqlite database using sqlalchemy. </p>
  
  <p>The way that I am thinking is: </p>
  
  <ol>
  <li><p>Declare a class in python with all the variable name: </p>
  
  <pre><code>class Designs(Base):
    __tablename__='designs'
    __table_args__ = {'sqlite_autoincrement': True}
    design_name= Column(String(80),nullable=False,primary_key=True)
    user_name= Column(String(80),nullable=False,primary_key=True)
    rev_tag= Column(String(80),nullable=False,primary_key=True)
   ...... much more variables.....
  </code></pre></li>
  <li><p>Read the JSON (using python json package and store it one by one) </p>
  
  <pre><code>import json
  data = json.load(open('xxx.json'))
  for key, value in data.iteritems():
     store it in the sql database
  </code></pre></li>
  </ol>
  
  <p>But if my JSON file is very big, declaring all variables in the class seems very troublesome and hard to maintain as I plan to further grow my JSON file. </p>
  
  <p>Wondering if there are any better way to do it</p>