Converting JSON into newline delimited JSON in Python : <p>My goal is to convert JSON file into a format that can uploaded from Cloud Storage into BigQuery (<a href="https://cloud.google.com/bigquery/docs/loading-data-cloud-storage-json" rel="noreferrer">as described here</a>) with Python.</p>

<p>I have tried using <a href="https://github.com/geowurster/NewlineJSON" rel="noreferrer">newlineJSON</a> package for the conversion but receives the following error.</p>

<pre><code>JSONDecodeError: Expecting value or ']': line 2 column 1 (char 5)
</code></pre>

<p>Does anyone have the solution to this?</p>

<p>Here is the sample JSON code:</p>

<pre><code>[{
    "key01": "value01",
    "key02": "value02",
    ...
    "keyN": "valueN"
},
{
    "key01": "value01",
    "key02": "value02",
    ...
    "keyN": "valueN"
},
{
    "key01": "value01",
    "key02": "value02",
    ...
    "keyN": "valueN"
}
]
</code></pre>

<p>And here's the existing python script:</p>

<pre><code>with nlj.open(url_samplejson, json_lib = "simplejson") as src_:
    with nlj.open(url_convertedjson, "w") as dst_:
        for line_ in src_:
            dst_.write(line_)
</code></pre>
