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.11.0.tar.gz
(50.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file firebase_rest_api-1.11.0.tar.gz.
File metadata
- Download URL: firebase_rest_api-1.11.0.tar.gz
- Upload date:
- Size: 50.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00accdd9030065ff02b50d1710a3d11e16cbc601730e980aac4ef481206d0a92
|
|
| MD5 |
d39be7d11d638c23a3f63f735addefbf
|
|
| BLAKE2b-256 |
abd0dc4dab4c1b2690593e09dfd7b5672a9278611d7879b9abbcca132a732718
|
File details
Details for the file firebase_rest_api-1.11.0-py3-none-any.whl.
File metadata
- Download URL: firebase_rest_api-1.11.0-py3-none-any.whl
- Upload date:
- Size: 28.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.31.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3a3dba2356b591dea686a78d972f649add1cc9512a0d18011b1d4657c9750ecc
|
|
| MD5 |
435ceb0ad52d4fa3605037313546285b
|
|
| BLAKE2b-256 |
778be33c24538882924c21fd4e6e64a9ccb2563db7f52a2332d22e6af0a8acdb
|