Firestore to Pandas Dataframe

November 17, 2020
import pandas as pd

ref = db.collection(u'user')
docs = ref.stream()

items = list(map(lambda x: {**x.to_dict(), 'id': x.id}, docs))

df = pd.DataFrame(items) # , columns=['id', 'email']
df.set_index('id', inplace=True)
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.