title: modify the sql result to json in python
body: <p>I know this might be a level 0 question, but I'm stuck here</p>
  <p>I'm using SQL Alchemy to get the sql result.</p>
  <pre><code>with db.connect() as conn:
      data = conn.execute('''select * from tables''')
      json_data = json.dumps([(dict(row.items())) for row in data])
      conn.close()
      return json_data
  </code></pre>
  <p>The result for the above snippet is</p>
  <pre><code>[{&quot;id&quot;: 1, &quot;name&quot;: &quot;Ashton&quot;, &quot;age&quot;: 20, &quot;nationality&quot;: &quot;US&quot;}, {&quot;id&quot;: 2, &quot;name&quot;: &quot;Kevin&quot;, &quot;age&quot;: 20, &quot;nationality&quot;: &quot;US&quot;}]
  </code></pre>
  <p>But how do I get the response with a name?</p>
  <pre><code>{&quot;citizens&quot;:[{&quot;id&quot;: 1, &quot;name&quot;: &quot;Ashton&quot;, &quot;age&quot;: 20, &quot;nationality&quot;: &quot;US&quot;}, {&quot;id&quot;: 2, &quot;name&quot;: &quot;Kevin&quot;, &quot;age&quot;: 20, &quot;nationality&quot;: &quot;US&quot;}]}
  </code></pre>