A simple python wrapper for Google's Firebase REST API's.
Project description
Firebase REST API
A simple python wrapper for Google's Firebase REST API's.
Installation
pip install firebase-rest-api
Quick Start
In order to use this library, you first need to go through the following steps:
-
Select or create a Firebase project from Firebase Console.
-
Register an Web App.
Example Usage
# Import Firebase REST API library
import firebase
# Firebase configuration
config = {
"apiKey": "apiKey",
"authDomain": "projectId.firebaseapp.com",
"databaseURL": "https://databaseName.firebaseio.com",
"projectId": "projectId",
"storageBucket": "projectId.appspot.com",
"messagingSenderId": "messagingSenderId",
"appId": "appId"
}
# Instantiates a Firebase app
app = firebase.initialize_app(config)
# Firebase Authentication
auth = app.auth()
# Create new user and sign in
auth.create_user_with_email_and_password(email, password)
user = auth.sign_in_with_email_and_password(email, password)
# Firebase Realtime Database
db = app.database()
# Data to save in database
data = {
"name": "Robert Downey Jr.",
"email": user.get('email')
}
# Store data to Firebase Database
db.child("users").push(data, user.get('idToken'))
# Firebase Storage
storage = app.storage()
# File to store in storage
file_path = 'static/img/example.png'
# Store file to Firebase Storage
storage.child(user.get('localId')).child('uploaded-picture.png').put(file_path, user.get('idToken'))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
firebase-rest-api-1.6.0.tar.gz
(44.6 kB
view details)
Built Distribution
File details
Details for the file firebase-rest-api-1.6.0.tar.gz
.
File metadata
- Download URL: firebase-rest-api-1.6.0.tar.gz
- Upload date:
- Size: 44.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98b0dd7053a92b058fbe797d3bcd70ee2a2b147d18a601dd43823124b78e7a2a |
|
MD5 | 06ee16df7a944acd6136c407b23c8e92 |
|
BLAKE2b-256 | 28e37d1f9175e272ec28297372f31a99a5abcb207b0d7fdcc6df5da49f61a327 |
File details
Details for the file firebase_rest_api-1.6.0-py3-none-any.whl
.
File metadata
- Download URL: firebase_rest_api-1.6.0-py3-none-any.whl
- Upload date:
- Size: 25.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80f8c5cc5d20dc8e3172676f9ee3fb99015a4b81cd9cba6624055274e88487e6 |
|
MD5 | 00879692800b06cce9594e548eb6b2f8 |
|
BLAKE2b-256 | 8e500b517c6761962b1cfc5e202241b8841e8fbcae751a479c7f1146c843010a |