Skip to main content

🔥👑 FireLit: Streamlit App with Firebase Authentication

Project description

Firelit

code-check Open in Streamlit

🔥👑 FireLit: Streamlit App with Firebase Authentication

Firelit Logo

Installation

You can install Firelit as a pip package.

pip install firelit

You can check the installation by running the following command in your terminal.

python -c "import firelit as ft; print(ft.__version__)"

Getting started

Configuration

Firelit needs to be connected to a firebase Web App.

You can create a new Web App in your Firebase project by following the steps below.

  • TODO

The configuration file can be provided as a firelit_config.yml file in the root directory of your Streamlit app.

  apiKey: <apiKey>
  authDomain: <authDomain>
  databaseURL: <databaseURL>
  projectId: <projectId>
  storageBucket: <storageBucket>
  messagingSenderId: <messagingSenderId>
  appId: <appId>
  measurementId: <measurementId>

or can be passed to the FirebaseAdmin class as a python dictionary or as a path to the desired configuration file.

import firelit as ft

ft.FirebaseAdmin(config="firelit_config.yml")

or

import firelit as ft
from firelit.utils import load_yaml

config_dict = load_yaml("firelit_config.yml")

Using Firelit (backend)

import firelit as ft

user_info = dict(email="user@gmail.com",
                 password="firelit")

admin = ft.admin.FirebaseAdmin()
admin.login(user_info["email"], user_info["password"])

Using Firelit (frontend)

import streamlit as st

from firelit.frontend import firelit_login_form

if __name__ == "__main__":
    st.set_page_config(
        page_title="Firelit Demo App",
        page_icon="🔥",
        layout="wide",
    )

    st.title("🔥 Firelit Demo App")
    st.subheader("This is a demo app for the Firelit package")
    sidebar = st.toggle("Show login form in the sidebar", key="sidebar_login")

    admin = firelit_login_form(sidebar=sidebar)

    if not admin.authentication_status:
        st.write("Please login to continue")
    else:
        st.write("You are logged in")
        st.balloons()

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

firelit-0.1.4.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

firelit-0.1.4-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

Details for the file firelit-0.1.4.tar.gz.

File metadata

  • Download URL: firelit-0.1.4.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.0 CPython/3.11.4 Darwin/22.6.0

File hashes

Hashes for firelit-0.1.4.tar.gz
Algorithm Hash digest
SHA256 9c1117bd8098de2fb730d00d77ed17b1a1b4833d4770a12ac22b8705e6428d39
MD5 ebf0d049f25f5f790de27ac5e2fa81c2
BLAKE2b-256 cc5550f332cb5a880e25ef5304e8c83dc3a2affbcdcfe20ac4898beba3d7dfc4

See more details on using hashes here.

File details

Details for the file firelit-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: firelit-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.6.0 CPython/3.11.4 Darwin/22.6.0

File hashes

Hashes for firelit-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 bc5314217b60d345bedb9bf4d2c46b232c21237f1992c394b8a55bf2603b0d0f
MD5 1db80dde5bae624b500765c5517bf762
BLAKE2b-256 7d12a00befae445bcc9342e1272fa6e03b8ddb135500ad488b0db581bd6c2010

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