I am growing through Python, to read a JSON file present on Firebase Storage via the admin sdk. I have already read the following question
How to download file from firebase storage in python using firebase_admin
but in this case the file is downloaded to another file. Is it possible instead to read it without downloading it and without making it public? Or alternatively is it possible to make a temporary file and once python prints it deletes it? Thank you
My code:
import firebase_admin
from firebase_admin import credentials, storage
cred = credentials.Certificate('serviceAccount.json')
firebase_admin.initialize_app(cred, {
"storageBucket": "**.appspot.com"
})
source_blob_name = "UQ4ADY.json"
#The path to which the file should be downloaded
destination_file_name = r"temp\ftmp.json"
bucket = storage.bucket()
blob = bucket.blob(source_blob_name)
blob.download_to_filename(destination_file_name)
Be aware that there may be a lot of requests and that is why I prefer not to download the files