Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Query Firebase using python-firebase

How does one query Firebase using Python? I am using python-firebase and can do simple gets (e.g. all entities) but need to query for a subset of entities. Any pointers would be helpful. I have successfully done this using JavaScript BTW.

like image 705
MoreScratch Avatar asked Mar 28 '16 23:03

MoreScratch


Video Answer


1 Answers

You can now use Firebase Admin Python API to get at the database

https://firebase.googleblog.com/2017/07/accessing-database-from-python-admin-sdk.html?m=1

from firebase_admin import db

root = db.reference()
x = db.reference('users/{0}'.format(new_user.key)).get()
print 'Name:', x['name']
print 'Since:', x['since']

python-firebase isn't keeping up to date with firebase api change

Latest commit over 2 years ago

like image 98
OneCricketeer Avatar answered Oct 23 '22 03:10

OneCricketeer