| from firebase import firebase | |
| import os | |
| secret=os.environ['FIREBASE_TOKEN'] | |
| user_id="123" | |
| auth=firebase.FirebaseAuthentication(secret=secret,email="anubhav77@gmail.com",extra={"id":user_id}) | |
| fb_url="https://device-1a455.firebaseio.com" | |
| fb= firebase.FirebaseApplication(fb_url,auth) | |
| base_dir="/users/"+user_id | |
| def fb_get(item): | |
| """ item need to be in format d2_refreshtoken same name will be present in the firebase | |
| d2 means second dropbox instance or app. | |
| """ | |
| return fb.get(base_dir,item) | |
| def fb_update(item,value): | |
| """ item need to be in format d2_refreshtoken same name will be present in the firebase | |
| d2 means second dropbox instance or app. | |
| """ | |
| return fb.patch(base_dir,{item:value}) |