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.5.tar.gz
(32.3 kB
view details)
Built Distribution
File details
Details for the file firebase-rest-api-0.4.5.tar.gz
.
File metadata
- Download URL: firebase-rest-api-0.4.5.tar.gz
- Upload date:
- Size: 32.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.28.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9abc40096fc08470cca305cef3036cf9beed3a921c47d926387814d6147a0c9 |
|
MD5 | 63a6a219c50ef58160141056396aac84 |
|
BLAKE2b-256 | f39e2bfe4c02a6d391df281c785df0b591a75bf1ba1384f88095d069bdc462f5 |
File details
Details for the file firebase_rest_api-0.4.5-py3-none-any.whl
.
File metadata
- Download URL: firebase_rest_api-0.4.5-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 | 4ed844b0a69dd4da67484bd25c68e677bc3e83f5a09f771ae301ee2fdc7b6cbc |
|
MD5 | 68014431d705b7f947db171348d5ae85 |
|
BLAKE2b-256 | 669808cc50eafc692a40cd44332d317bc6558fd49cc4040302852a568f9c64f8 |