title: How to get the output into a json format?
body: <p>Code:::</p>
  
  <pre><code>from bottle import route, request, response, template,run
  import petl as etl
  @route('/loc')
  def abc():
      response.headers['Access-Control-Allow-Origin']='*'
      response.headers['Content-type']='application/json'
      post = request.query.postcode
      locationTable = etl.fromcsv('clinic_locations.csv')
      abcd = etl.search(locationTable, 'Postcode', post)
      return template('{{postcode}}',postcode=abcd)
  </code></pre>
  
  <p>Here is the <a href="https://drive.google.com/open?id=1Erkx0MGaJr87F3g0r--eUM0LxzwNTfXG" rel="nofollow noreferrer">csv</a> File ,I want to get the result in json but i dont know to do i get it beacuse I am very new to petl and bottle framework
  When user enter the url on the browser e.g "localhost:8080/loc?postcode=4700" it will return  the data regarding to that postal code but in csv format but i want to get the output in json format so i can user this data to find the address on the map
  Can any one help me to get the result</p>
  
  <p>Example: My desired ouput on browser after running localhost by bottle framework is:</p>
  
  <p><a href="https://i.stack.imgur.com/wlLeS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wlLeS.png" alt="enter image description here"></a></p>
  
  <p><strong>Updated</strong>
  But what I am getting is this:
  <a href="https://i.stack.imgur.com/pxHvb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pxHvb.png" alt="enter image description here"></a></p>