google-cloud-functions

Howto write a python-based firebase https function?

Howto write a python-based firebase https function? Question: I would like to call a backend function from my mobile app. However this backend function shall be written in python. This function shall be directly callable from my mobile app, it shall access firebase, do some computations and return the result (Ideally, only if the user …

Total answers: 2

HTTP trigger Cloud Function in Flutter web

HTTP trigger Cloud Function in Flutter web Question: I am trying to call a HTTP trigger Cloud Function from Flutter. I keep getting errors in the console while passing the parameters to the function. final HttpsCallable callable = CloudFunctions.instance.getHttpsCallable( functionName: ‘hello_world’, ); final HttpsCallableResult result = await callable.call( <String, dynamic>{ ‘message’: ‘hello world!’, }, ); …

Total answers: 1

Firebase cloud functions using Python?

Firebase cloud functions using Python? Question: We are using GCP’s Firebase with Firestore for a new mobile app we are developing. As part of this effort we need to deploy a number of cloud functions which will act as Firestore triggers for doing some back end processing. Our intention is to keep the deploys encapsulated …

Total answers: 1

Accessing data in blob object from download_as_string in Python

Accessing data in blob object from download_as_string in Python Question: I am trying to access and modify data in a newline JSON file pulled from Google Cloud Storage in Google Cloud Functions. The results always show up as numbers despite that not being the data in the JSON. I see that download_as_string() for blob object …

Total answers: 3

Can or How to use Python asyncio on Google Cloud Functions?

Can or How to use Python asyncio on Google Cloud Functions? Question: Is it possible to use Python’s asyncio on Google Cloud Functions? async def handle_someting(): # do something some = await aiofunc() # Do I need the code below? loop = asyncio.get_event_loop() loop.run_until_complete(handle_someting()) loop.close() Asked By: Sagnol || Source Answers: Sure, you just need …

Total answers: 2

How to pass a variable in Json object while giving HTTP post request in Python

How to pass a variable in Json object while giving HTTP post request in Python Question: I am trying to pass a json object to one of my URLs which accepts the JSON data. The code below works: import requests import json payload='{"message": "hello"}’ headers = {‘content-type’: ‘application/json’, ‘Accept-Charset’: ‘UTF-8’} r = requests.post(url, data=payload, headers=headers) …

Total answers: 3

Write to Google Cloud Storage from Cloud Function (python)

Write to Google Cloud Storage from Cloud Function (python) Question: I am trying to upload a file to google cloud storage from within a cloud function. I can’t import the cloud storage library into my function, though. Can cloud storage be used from within cloud functions in this manner? Cloud Function from google.cloud import storage …

Total answers: 1