I can't find an example of how to use the google cloud storage WITHOUT running it on google appengine.
I want something like this (which works good for me): https://github.com/GoogleCloudPlatform/storage-getting-started-javascript/ but implemented in python instead.
So what I want to archive is that my frontend asks my python backend which then asks the cloud storage. I can't seam to find any examples that doesn't use appengine to authenticate, but it cant be impossible.
I've looked at both a couple of examples on https://github.com/GoogleCloudPlatform/ but i can't find one without dependencies on appengine.
It also has to run on python3.
is this what you are looking for? blob has functions to download from file, upload to a file. You can do pretty much everything with GCS using these functions
from google.cloud import storage
client = storage.Client()
bucket = client.get_bucket('bucket-name')
blob = bucket.get_blob('path-to-file')
data = blob.download_as_string()
few more functions, they have some more
download_to_filename
upload_from_file
You can use gsutil
to access Google Cloud Storage from the command line. There is a getting started tutorial here.
There is a Python example using gsutil here:
This tutorial shows you how to write a simple Python program that performs basic Google Cloud Storage operations using the XML API.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With