0

A team member is working on Machine Learning in Python, to get the data from the users in our social network (stored in Firebase Cloud Firestore) in the form of a json or text file, analyse it, get some useful info from it, like topics, and send that info back to Firestore database.

However, I know that we can't currently run Python in Cloud Functions, so I can't have the scripts there if I wanted to.

I need a way to host python scripts that can be executed whenever I need to analyse data, and I found that AWS Lambda provides a way to do this.

But I'm struggling to understand how to connect Cloud Functions with this service (AWS Lambda), so I can execute the code whenever I need it by sending data from Firebase to AWS Lambda through Functions, and then get the analysis back from AWS Lambda to Firebase through Functions.

I'd thank if you could help me with the way to connect them.

Franco Muñiz
  • 811
  • 1
  • 10
  • 21
  • You can run Python in Cloud Functions. You just can't use Firebase triggers yet. – Doug Stevenson Sep 17 '18 at 18:18
  • I need to use the triggers to detect new data and use the python script to add it and process it if needed. – Franco Muñiz Sep 17 '18 at 18:21
  • Is it possible to trigger a (python) cloud function from a firestore trigger function? I have no idea if that's possible, if it is then it'd be awesome. Like I use a firebase js function, detect new data, send it to the python function, then return it to the js function and after everything's done, return it to database – Franco Muñiz Sep 17 '18 at 18:24
  • Sure, you can do that. – Doug Stevenson Sep 17 '18 at 19:04
  • Here is a link for a code on NodeJS to do that - may be you can do something similar in Python ? - https://stackoverflow.com/questions/37325775/amazon-lambda-to-firebase – Ula Dec 09 '18 at 14:23

0 Answers0