Skip to content

Instantly share code, notes, and snippets.

@1UC1F3R616
Last active February 9, 2020 11:45
Show Gist options
  • Save 1UC1F3R616/aefee6ca02748631f36d0fa9e2a5e137 to your computer and use it in GitHub Desktop.
Save 1UC1F3R616/aefee6ca02748631f36d0fa9e2a5e137 to your computer and use it in GitHub Desktop.

CRUD

# pip install python-firebase

from firebase import firebase

firebase = firebase.FirebaseApplication("https://hale-ivy-111111s.firebaseio.com/", None)

data = {
    'Name':'Kush',
    'Email':'kush8@gmail.com',
    'Phone':9588
}

# Post
firebase.post('MySet1', data)

# Get
firebase.get('/MySet1', '')

# Put
firebase.put('/MySet1/M-bFiZx_zJymOMeee-f', 'Email', 'sehlwani8@gmail.com')

# Delete
firebase.delete('/MySet1/-M-bFiZx_zJymOMeee-f/', 'Email')

Email and Pass login | SingIn | Email Verification | Forgot Password

# https://github.com/thisbejim/Pyrebase

import pyrebase
from getpass import getpass
 
 
firebaseConfig = {
 
    "apiKey": "YOUR API KEY",
    "authDomain": "mytest-91572.firebaseapp.com",
    "databaseURL": "https://mytest-91572.firebaseio.com",
    "projectId": "mytest-91572",
    "storageBucket": "mytest-91572.appspot.com",
    "messagingSenderId": "558021857077",
    "appId": "1:558021857077:web:63b4ff6e71edb9211bc67c",
    "measurementId": "G-HL4NZ8QSN9"
 
}
 
 
firebase = pyrebase.initialize_app(firebaseConfig)
 
 
auth = firebase.auth()
 
 
email = input("Please Enter Your Email Address : \n")
password = getpass("Please Enter Your Password : \n")
 
#create users
user = auth.create_user_with_email_and_password(email, password)
print("Success .... ")
 
 
login = auth.sign_in_with_email_and_password(email, password)
 
#send email verification
auth.send_email_verification(login['idToken'])
 
 
#reset the password
auth.send_password_reset_email(email)
 
print("Success ... ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment