A simple python wrapper for Google's Firebase REST API's.
Project description
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.10.1.tar.gz
(50.3 kB
view hashes)
Built Distribution
Close
Hashes for firebase_rest_api-1.10.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fab81ee445ed1f6b1716db5c04723d3a56602860bff22e8304c8a358fdea4bf6 |
|
MD5 | 78cc27ea373e7856329d80d6209407f8 |
|
BLAKE2b-256 | 21caa9d781abfedd1db87b70b9093c5570bbbfb22a37b44a03c17ab6557342a7 |