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.4.0.tar.gz
(42.4 kB
view details)
Built Distribution
File details
Details for the file firebase-rest-api-1.4.0.tar.gz
.
File metadata
- Download URL: firebase-rest-api-1.4.0.tar.gz
- Upload date:
- Size: 42.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a7414b0b57fb853f7cabc080dd54040d994f217c3979d798fb4a7b1f5fc9781 |
|
MD5 | 4fe26a746a4239e222b944d3525b517e |
|
BLAKE2b-256 | eebe7e2d923f66eaa021676362628ffded9a9b152b12abd0cd26f6948f36b6f2 |
File details
Details for the file firebase_rest_api-1.4.0-py3-none-any.whl
.
File metadata
- Download URL: firebase_rest_api-1.4.0-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42e23c49f5123aa8a5bf18164cc443ba2d34c11e9bd9dbf0b8ee8ada035b7246 |
|
MD5 | 11c67770ccbfe1407bac8db776261f4c |
|
BLAKE2b-256 | 31956dbc5333a8d9b144205d86743815f81b6a2d9ab7bd5ce3b907ba1f29734a |