title: Writing a new file to a Google Cloud Storage bucket from a Google Cloud Function (Python)
body: <p>I am trying to write a new file (not upload an existing file) to a Google Cloud Storage bucket from inside a Python Google Cloud Function.</p>
  
  <ul>
  <li><p>I tried using <a href="https://pypi.org/project/google-cloud-storage/" rel="nofollow noreferrer"><code>google-cloud-storage</code></a> but it does not have the
  "open" attribute for the bucket.</p></li>
  <li><p>I tried to use the App Engine library <a href="https://cloud.google.com/appengine/docs/standard/python/googlecloudstorageclient/read-write-to-cloud-storage" rel="nofollow noreferrer"><code>GoogleAppEngineCloudStorageClient</code></a> but the function cannot   deploy with this dependencies.</p></li>
  <li><p>I tried to use <a href="https://pypi.org/project/gcs-client/" rel="nofollow noreferrer"><code>gcs-client</code></a> but I cannot pass the credentials inside the function as it requires a <code>JSON</code> file.</p></li>
  </ul>
  
  <p>Any ideas would be much appreciated.</p>
  
  <p>Thanks. </p>