Squadbase Python SDK for Streamlit
SDK for streamlit to get user credentials in deployment environment on squadbase.
Features
- Retrieve user information from Squadbase authentication API
- Support for local development with mock data
- Custom domain configuration
Installation
pip install squadbase-streamlit
or with Poetry:
poetry add squadbase-streamlit
Usage
In Squadbase Deployment Environment
When deployed on Squadbase, the SDK automatically extracts authentication information from the request headers:
import streamlit as st
import squadbase.streamlit as sq
# Get Squadbase user information
user_info = sq.auth.get_user()
# Store in session state for reuse
st.session_state['user_info'] = user_info
# Access user data
st.write(f"Welcome, {user_info.get('firstName', '')} {user_info.get('lastName', '')}")
In Local Development Environment
For local development, you can use mock data to simulate the authentication:
import streamlit as st
import squadbase.streamlit as sq
# Define mock user data for local testing
mock_user_data = {
"username": "testuser",
"firstName": "Test",
"lastName": "User",
"iconUrl": None,
"email": "test@example.com",
"role": ["Admin"]
}
# Get mock user information
user_info = sq.auth.get_user(mock_data=mock_user_data)
# Use the user information in your app
st.write(f"Hello, {user_info['firstName']} {user_info['lastName']}")
Metadata
Release files for squadbase-streamlit 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| squadbase_streamlit-0.0.1.tar.gz | 2.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| squadbase_streamlit-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.4 kB
Release files / squadbase_streamlit-0.0.1.tar.gz
| Download URL | squadbase_streamlit-0.0.1.tar.gz |
|---|---|
| Size | 2.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ad67706225b5f489ae8f371ff7f930f0931cb9625bc8688c1879865854344ae
|
|
BLAKE2b-256 checksum How to use checksums |
39d84ecc449ddc0c229d8e2e01466b84af3226b0684ef88c98a98c50a47ab0e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.9.4 Darwin/23.3.0
|
Release files / squadbase_streamlit-0.0.1-py3-none-any.whl
| Download URL | squadbase_streamlit-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
81704c12406624dc5943c3819eb2335f99a87a07c1840c194f94d03b82c4bfe7
|
|
BLAKE2b-256 checksum How to use checksums |
1d8426ca47f441eff6132641ba745731e65827575eea6de5ba49c3ad93f0bc21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.8.2 CPython/3.9.4 Darwin/23.3.0
|
Security for squadbase-streamlit 0.0.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.