Skip to main content

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:

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

Uploaded Source

Built Distribution

firebase_rest_api-1.8.1-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for firebase-rest-api-1.8.1.tar.gz
Algorithm Hash digest
SHA256 b26eeb94cc670bb3c5205ec072a80b785c24500b15cc1ab446024e943a631677
MD5 2a02358af899be1a124ec026cfd31edb
BLAKE2b-256 03e4fa0a5c9e2ff3c31c6f80ca4ea41640d3b3128ab6679439c8998b6b21e8cd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for firebase_rest_api-1.8.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d9dbbd2ee05d4a4f3d8031d543b9c1b2927f2d9260081b2c8dad3bb85a4f5842
MD5 5328c815aa84a8ba1e0c97e5c05bb2f6
BLAKE2b-256 a2f1eee16c7d117f256c8f55a23176f0b766c670cc0df1d705f797ec843f39b4

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