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
Metadata
Release files for streamlit-admin 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| streamlit_admin-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Release files / streamlit_admin-0.1.1-py3-none-any.whl
| Download URL | streamlit_admin-0.1.1-py3-none-any.whl |
|---|---|
| Size | 6.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aeba2b6a729f76fda0250e5110d7a83177888f466c805cf1fc22a4b55288481f
|
|
BLAKE2b-256 checksum How to use checksums |
80f051bb500b9340c18dc2c5fa6c5981bced4cc1efbefcc81d3e31614c74f06d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.12
|
Security for streamlit-admin 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.