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('email')).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-0.4.7.tar.gz
(33.0 kB
view details)
Built Distribution
File details
Details for the file firebase-rest-api-0.4.7.tar.gz
.
File metadata
- Download URL: firebase-rest-api-0.4.7.tar.gz
- Upload date:
- Size: 33.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 20dcda2b9f199214d847612e2067d9f352557f16e37e99cfdb56c5d82159a93e |
|
MD5 | 9f9064b3e467f229095516dd73c825c5 |
|
BLAKE2b-256 | a3c1ac0111db21e0210ca661b1cc1d7f8d052506b0329f725a0fdb26dc79ad34 |
File details
Details for the file firebase_rest_api-0.4.7-py3-none-any.whl
.
File metadata
- Download URL: firebase_rest_api-0.4.7-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3120c828d4e52f646b53dcb37197a4aa7e803202c5b99de894bdb2530c46c4fe |
|
MD5 | df089031901e58acaa8260bcb75f5f2c |
|
BLAKE2b-256 | ab5056a37b3c074a7a5d7cf2c7742c7f75ad993206204d00a16c6c060474cb7d |