firebase-admin

Firestore Python SDK – count() aggregation

Firestore Python SDK – count() aggregation Question: I’m using Firebase Firestore in my Python project (with their official Python SDK) and having trouble performing count() aggregation. This funciton is supported according to their docs. However, they do not provide Python example ( they do in other parts of documentation ). I tried to play with …

Total answers: 2

Firebase credentials as Python environment variables: Could not deserialize key data

Firebase credentials as Python environment variables: Could not deserialize key data Question: I’m developing a Python web app with a Firestore realtime database using the firebase_admin library. The Firestore key comes in form of a .json file containing 10 variables. However, I want to store some of these variables as environment variables so they are …

Total answers: 2

Initializing 2 firebase apps in python

Initializing 2 firebase apps in python Question: As part of my project, I’ve made 2 different Firestore databases. Usually, when I work with 1, it sets up fine in my project file. Now that I’m implementing BOTH of them in my python file (running discord.py), it throws up an error! Here’s the code for reference: …

Total answers: 1

how to delete document without deleting collection in firestore?

how to delete document without deleting collection in firestore? Question: I want to create some kind of collection which cannot be deleted. The reason I made it like that is because when the document is empty my website can’t do the data creation process is it possible to create a collection in firestore that has …

Total answers: 1

Initializing Firebase Admin via Environment Variables without storing serviceAccount.json

Initializing Firebase Admin via Environment Variables without storing serviceAccount.json Question: I am trying to initialize firebase-admin on my Flask API. Based off the documentation, the method initialize_app can take a dictionary as an input as seen here: https://github.com/firebase/firebase-admin-python/blob/6d826fd15c87db62f7501f569b6e0a762d17a05e/firebase_admin/credentials.py#L85 That said, I structured my code as follows: import firebase_admin from firebase_admin import auth, credentials … firebase_admin.initialize_app({ …

Total answers: 3

Firebase-Admin with AWS Lambda Python

Firebase-Admin with AWS Lambda Python Question: I am currently writing a Python server to deploy on AWS Lambda. I want to use the firebase-admin package to send notifications with FCM and read data from cloud firestore. however when I try deploying my function to AWS Lambda with the .zip file archives, I get this error …

Total answers: 4

Extract Created date and last login from firebase authentication using Python

Extract Created date and last login from firebase authentication using Python Question: Currently my python code gets the user id and email of all users from firebase authentication using the firebase admin SDK, however I am unable find the correct syntax to extract the user metadata such as the created and last login date/time (which …

Total answers: 3

I can't install install firebase-admin

I can't install install firebase-admin Question: I’ve got an error following: MacBook-Air:Firebase takeyuki$ python -m pip install –upgrade firebase-admin DEPRECATION: Python 2.7 will reach the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 won’t be maintained after that date. A future version of pip will drop support for …

Total answers: 2