title: Python conversion from JSON to JSONL
body: <p>I wish to manipulate a standard JSON object to an object where each line must contain a separate, self-contained valid JSON object. See <a href="http://jsonlines.org/" rel="noreferrer">JSON Lines</a></p>
  
  <pre><code>JSON_file =
  
  [{u'index': 1,
    u'no': 'A',
    u'met': u'1043205'},
   {u'index': 2,
    u'no': 'B',
    u'met': u'000031043206'},
   {u'index': 3,
    u'no': 'C',
    u'met': u'0031043207'}]
  </code></pre>
  
  <p><code>To JSONL</code>:</p>
  
  <pre><code>{u'index': 1, u'no': 'A', u'met': u'1043205'}
  {u'index': 2, u'no': 'B', u'met': u'031043206'}
  {u'index': 3, u'no': 'C', u'met': u'0031043207'}
  </code></pre>
  
  <p>My current solution is to read the JSON file as a text file and remove the <code>[</code> from the beginning and the <code>]</code> from the end. Thus, creating a valid JSON object on each line, rather than a nested object containing lines.</p>
  
  <p>I wonder if there is a more elegant solution? I suspect something could go wrong using string manipulation on the file.</p>
  
  <p>The motivation is to read <code>json</code> files into RDD on Spark. See related question - <a href="https://stackoverflow.com/questions/38895057/reading-json-with-apache-spark-corrupt-record/38895521#38895521">Reading JSON with Apache Spark - `corrupt_record`</a></p>