Firebase with Python

Firebase is a mobile and web application development platform by Google. Firebase platform has approx 18 products ready to be implemented in the project.
Features of firebase can be implemented in python using Firebase Admin SDK for Python. In this post, we will tackle Firebase Authentication and Storage which are essential for most of the projects.
Create a Firebase App
- Open your Firebase Console and create an app or find an existing app.
- Download the Firebase config file which is in JSON format this file is needed to be mentioned inside your project. In the project‘s console, the config file can be downloaded from Settings > Project Settings >Service Accounts > Firebase Admin SDK > Generate New Private Key
Install the Firebase SDK:
Install the Firebase Admin SDK for python using pip.
Configure SDK in Python Project
Importing Firebase Admin to project
Creating a Firebase app instance
Implementing Firebase Auth
Firebase Auth is a service that can authenticate users using only client-side code.
Importing Firebase Auth to project
Creating a User
Retrieving User Data
Functions used to retrieve user data returns UserRecord object using which we can access user information.
Using User Id
Using Email Id
All Users
Updating User Data
Deleting User Data
Implementing Firebase Storage
Firebase Storage provides secure file uploads and downloads for Firebase apps. The developer can use it to store images, audio, video, or other user-generated content.
Importing Firebase Storage to project
Configuring Firebase Storage bucket
Uploading File to Firebase Storage
Delete File from Firebase Storage
Making a File Public
Generating access URL for a file
The saved file inside bucket needs to be accessed in some manner most common way to access a file is through URL. Firebase provides a way to generate
Signed URL- URL which is valid for a specific time after which they get expired.
Public URL- URL which is valid till the file is present in storage. To get a public URL file should be public.
This article just provides configuration of Firebase and basic implementation of some features of Firebase. For more references please refer to Firebase docs.
Thanks for being till last.😊😊
References:
