Async Firebase REST API
A simple python wrapper for Google's Firebase REST API's.
This package is an async fork of AsifArmanRahman/firebase-rest-api.
<img alt="Read the Docs" src="https://img.shields.io/readthedocs/async-firebase-rest-api?logo=Read%20the%20Docs&logoColor=white">
Installation
pip install async-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 Async 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
await auth.create_user_with_email_and_password(email, password)
user = await 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": await user.get('email')
}
# Store data to Firebase Database
await 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
await storage.child(user.get('localId')).child('uploaded-picture.png').put(file_path, user.get('idToken'))
Release files for async-firebase-rest-api 2.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| async_firebase_rest_api-2.2.0.tar.gz | 50.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| async_firebase_rest_api-2.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 77.7 kB
Release files / async_firebase_rest_api-2.2.0.tar.gz
| Download URL | async_firebase_rest_api-2.2.0.tar.gz |
|---|---|
| Size | 50.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1aa2e6e6aa4d25ce97201cae44408c732f32cfc35bce9ddd77057521f6309dcb
|
|
BLAKE2b-256 checksum How to use checksums |
dda8392b95c56242ed1c257086d921f54dbaa8b2fedef18a44befa1974970c44
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|
Release files / async_firebase_rest_api-2.2.0-py3-none-any.whl
| Download URL | async_firebase_rest_api-2.2.0-py3-none-any.whl |
|---|---|
| Size | 27.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57d0196d15a1a064100136aa2a544b171e04bbd95c619d8a301ecbec7fb3b60d
|
|
BLAKE2b-256 checksum How to use checksums |
fb42fa78700ba0490ee85a8ba1c373ad6163ca33bfe49722c626dd97fd990bdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.32.3
|