Integrate Firebase with Python using Pyrebase

What is Pyrebase ?

Pyrebase is a simple python wrapper for the Firebase API.Pyrebase was written for python 3 and will not work correctly with python 2. In layman’s terms, it allows you to use Python to manipulate your Firebase database,authentication and storage.






A Pyrebase app can use multiple Firebase services
1. Firebase Authentication -> firebase.auth()
2. Firebase Relatime Database -> firebase.database()
3. Firebase Storage -> firebase.storage()

Installing Pyrebase
we will install the Pyrebase and its dependencies using pip
Making Connection to Firebase
Now we can import the Pyrebase Module into a python file and make a connection to our Firebase database,storage and authentication
The apiKey, authDomain, databaseUrl, and storageBucket values needed to connect to your database can be found at by clicking the Web Setup link in the Auth tab of the Firebase console. The value for the serviceAccount is actually a JSON file that can be generated by Firebase.

Authentication
The default permissions of a Firebase database requires authentication to perform read or write actions. The simplest way to authenticate is by signing in with an email and password. A new user can be created in the Auth tab of the Firebase console. Once a user is created, the following Pyrebase code can be used to created an authentication connection.



CRUD Operations
1. C stands for Create
2. R stands for Read
3. U stands for Update
4. D stands for Delete

Create

Read

Update

Delete

Written By : Tushar Verma 
Source Code Github :  https://github.com/thisbejim/Pyrebase
Linkedin Profile : https://www.linkedin.com/in/tushar-verma-047329154/ 

Github Profile  : https://github.com/tushar821999/



Komentar

Postingan Populer