title: Python Tuple to JSON output
body: <p>How do I turn this:</p>
  
  <pre><code>data = ((1, '2011-01-01'), (2, '2011-01-02'), (1, '2011-01-15'), (3, '2011-02-01'))
  </code></pre>
  
  <p>into this:</p>
  
  <pre><code>{
      "item": [
       "1",
       "2",
       "1",
       "3",
      ],
      "settings": {
       "axisx": [
        "2011-01-01",
        "2011-01-02",
        "2011-01-15",
        "2011-02-01"
       ],
       "axisy": [
        "0",
        "100"
       ],
       "colour": "ff9900"
       }
  }
  </code></pre>
  
  <p>Or rather, are there any helpful resources that I can read so that I would be able to produce that JSON output? So I know I need to 'transform' my data into the right data structure. After that is it as easy as <code>json.dumps(data)</code></p>
  
  <p>Thanks</p>