Basic User Admin and Authenticator for Streamlit
Project description
Basic Authenticator for Streamlit Using Database
Loggin system based on pydal to connect Database. First user is Admin.
Install
pip install streamlit-admin
Usage Example
STAuthView(databaseInfo, databaseFolder)
databaseInfo -> see list of database
databaseFolder -> Folder to save data base info and data
User table
The basic authentication create the following user table:
database.define_table("users",
Field("username", "string", unique=True),
Field("email", "string", unique=True),
Field("password", "string"),
Field("role", "string", default="guest")
)
Usage Example
import streamlit as st
from streamlit_admin import AdminUsers, STAuth
#
auth = STAuth('sqlite://storage.db', './database')
admin = AdminUsers(auth)
if admin.session_state['loggedIn'] == False:
admin.login_page()
else:
admin.logout_page()
st.write("Oi Mundo")
Login Page
Sign (Create User) Page
Home Page with logout button
List of Database:
SQLite sqlite://storage.sqlite
MySQL mysql://username:password@localhost/test?set_encoding=utf8mb4
PostgreSQL postgres://username:password@localhost/test
MSSQL (legacy) mssql://username:password@localhost/test
MSSQL (>=2005) mssql3://username:password@localhost/test
MSSQL (>=2012) mssql4://username:password@localhost/test
FireBird firebird://username:password@localhost/test
Oracle oracle://username/password@test
DB2 db2://username:password@test \
Ingres ingres://username:password@localhost/test
Sybase sybase://username:password@localhost/test
Informix informix://username:password@test
Teradata teradata://DSN=dsn;UID=user;PWD=pass;DATABASE=test
Cubrid cubrid://username:password@localhost/test
SAPDB sapdb://username:password@localhost/test
IMAP imap://user:password@server:port
MongoDB mongodb://username:password@localhost/test
Google/SQL google:sql://project:instance/database
Google/NoSQL google:datastore
Google/NoSQL/NDB google:datastore+ndb
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
File details
Details for the file streamlit_admin-0.1.1-py3-none-any.whl
.
File metadata
- Download URL: streamlit_admin-0.1.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aeba2b6a729f76fda0250e5110d7a83177888f466c805cf1fc22a4b55288481f |
|
MD5 | 3f126602eaca700015792a432d8c3ce3 |
|
BLAKE2b-256 | 80f051bb500b9340c18dc2c5fa6c5981bced4cc1efbefcc81d3e31614c74f06d |