Skip to main content

A simple python wrapper for Google's Firebase REST API's.

Project description

Firebase REST API

build tests Documentation Status codecov PyPI - Python Version PyPI

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:

  1. Select or create a Firebase project from Firebase Console.

  2. 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


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.8.0.tar.gz (48.5 kB view details)

Uploaded Source

Built Distribution

firebase_rest_api-1.8.0-py3-none-any.whl (27.8 kB view details)

Uploaded Python 3

File details

Details for the file firebase-rest-api-1.8.0.tar.gz.

File metadata

  • Download URL: firebase-rest-api-1.8.0.tar.gz
  • Upload date:
  • Size: 48.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.28.1

File hashes

Hashes for firebase-rest-api-1.8.0.tar.gz
Algorithm Hash digest
SHA256 06df197ab3ae2895d1adf067b27708a4e83c2b90d56bc8e6ad1134cb31d6a025
MD5 29884b79597646e09e44d30dd8407af4
BLAKE2b-256 5e65606764b2e9bd56b54accc93c368bb459e9a4f6e1267d13e316852d4bbb69

See more details on using hashes here.

File details

Details for the file firebase_rest_api-1.8.0-py3-none-any.whl.

File metadata

File hashes

Hashes for firebase_rest_api-1.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e3e1e95aa532d18e09383335ab7764d40765cf374a82bef8f93aceb56972472c
MD5 7240853b9a90ba9ee8d27c6a9a094434
BLAKE2b-256 35323561c02b01bc37151791adb04c2a24cd0c31dd443eb6caa8fa8eb1d3652d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page