title: Using Python to generate JSON Data
body: <p>I'm working on a little project, the aim being to generate a report from a database for a server. The database is SQLite and contains tables like 'connections', 'downloads', etc. </p>
  
  <p>The report I produce will ultimately contain a number of graphs displaying things like 'connections per day', 'top downloads this month', etc.</p>
  
  <p>I plan to use <a href="http://code.google.com/p/flot/" rel="nofollow noreferrer">flot</a> for the graphs because the graphs it makes look very nice:<img src="https://i.stack.imgur.com/9CDnP.png" alt="flot graph"></p>
  
  <p>This is my current plan for how my reports will work:</p>
  
  <ul>
  <li><p>Static .HTML file which <em>is</em> the report. This will contain headings, embedded flot graphs, etc. </p></li>
  <li><p>JSON Data file. These will be generated by my report generation python script, they will basically contain a JSON variable for each graph representing the dataset that the graph should map. ([100,2009-2-2],[192,2009-2-3]...)</p></li>
  <li><p>Report generation python script, this will load the SQLite database, run a list of set SQL queries and spit out the JSON Data files.</p></li>
  </ul>
  
  <p>Does this sound like a sensible set up? I can't help but feel it could be improved but I don't see how. I want the reports to be static. The server they run on cannot take heavy loads so a dynamically generated report is out of the question and also unnecessary for this application.</p>
  
  <p>My concerns are:</p>
  
  <ul>
  <li><p>I feel that the Python script is largely pointless, all of the processing performed is done by SQLite, my script is basically going to be used to store SQL queries and package up the output. With a bit more work SQLite could probably do this for me.</p></li>
  <li><p>It seems I'm solving a problem that must have been solved many times before 'take sql queries, spit out pretty graphs in a daily report' must have been done hundreds of times. I'm just having trouble tracking down any broad implementations.</p></li>
  </ul>