title: How to read json gzipped file from GCS and write to table?
body: <p>I have a json compress with gzip file (.json.gz) stored in bucket in Google Cloud Storage in which I want to read it and copy it into a postgres table. The json.gz file I have is just a json file with no nested object in it like this:</p>
  <pre><code>[{
  “date”: “2019-03-10T07:00:00.000Z”,
  “type”: “chair”,
  “total”: 250.0,
  &quot;payment&quot;: &quot;cash&quot;
  },{
  “date”: “2019-03-10T07:00:00.000Z”,
  “type”: “shirt”,
  “total”: 100.0,
  &quot;payment&quot;: &quot;credit card&quot;
  },{
  .
  .
  }]
  </code></pre>
  <p>Previously I did similar job like this with csv file in which I can use <code>download_as_string</code> function and stored it in variable and use <code>StringIO</code> to convert that variable to file-like object and used <code>copy_expert()</code> function with the query (<a href="https://stackoverflow.com/questions/56042273/postgres-gcs-python-insert-data-stored-in-variable-that-read-from-gcs-to-postgr">this link</a>).</p>
  <p>So, how can I read a json.gz file in GCS and write it to a table with Python?</p>