Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/asifarmanrahman/firebase-rest-api
A simple python wrapper for Google's Firebase REST API's.
https://github.com/asifarmanrahman/firebase-rest-api
firebase firebase-auth firebase-auth-rest-api firebase-authentication firebase-database firebase-database-api firebase-db firebase-firestore firebase-firestore-database firebase-realtime-database firebase-realtime-db firebase-rest-api firebase-storage firebase-storage-api firestore-database
Last synced: 6 days ago
JSON representation
A simple python wrapper for Google's Firebase REST API's.
- Host: GitHub
- URL: https://github.com/asifarmanrahman/firebase-rest-api
- Owner: AsifArmanRahman
- License: mit
- Created: 2022-06-22T01:07:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-12-02T10:27:47.000Z (about 1 year ago)
- Last Synced: 2024-12-19T09:08:02.410Z (6 days ago)
- Topics: firebase, firebase-auth, firebase-auth-rest-api, firebase-authentication, firebase-database, firebase-database-api, firebase-db, firebase-firestore, firebase-firestore-database, firebase-realtime-database, firebase-realtime-db, firebase-rest-api, firebase-storage, firebase-storage-api, firestore-database
- Language: Python
- Homepage: https://firebase-rest-api.readthedocs.io
- Size: 224 KB
- Stars: 60
- Watchers: 3
- Forks: 14
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
## Installation
```python
pip install firebase-rest-api
```## Quick Start
In order to use this library, you first need to go through the following steps:
1. Select or create a Firebase project from [Firebase](https://console.firebase.google.com) Console.
2. Register an Web App.
### Example Usage
```python
# 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'))
```