This project demonstrates how to perform CRUD (Create, Read, Update, Delete) operations in Firebase using Python and the Firebase Admin SDK.
Firebase is a powerful cloud platform that provides a range of services for building and scaling web and mobile applications. In this project, we explore how to interact with Firebase's backend services programmatically using Python and the Firebase Admin SDK. We cover the process of setting up Firebase, initializing the Firebase Admin SDK, and performing CRUD operations in Realtime Database or Firestore.
- Python 3.x
firebase-admin
package- Firebase project with the necessary services enabled
-
Fork and clone the repository:
git clone <repo_url>
-
Navigate to the project directory:
cd pybase-crud
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
source venv/bin/activate
- Configure Firebase Admin SDK:
- Generate a private key file (service account key) in your Firebase project settings.
- Rename the generated JSON file to
serviceAccountKey.json
. - Place the
serviceAccountKey.json
file in the project directory.
-
Update the Firebase project configuration in the
main.py
file with your own project credentials. -
Run the Python Notebook
main.ipynb
to perform CRUD operations in Firebase.