FloAgent Python SDK
Python support for FloAgent external apps. The core handoff client has no runtime dependencies, and the optional Streamlit adapter handles authentication state and safe navigation.
Installation
python -m pip install floagent-sdk
For Streamlit apps:
python -m pip install "floagent-sdk[streamlit]"
Streamlit handoff
Construct navigation first so every redirect target is registered, then gate
page execution through StreamlitHandoff:
import streamlit as st
from floagent_sdk import HandoffClient
from floagent_sdk.streamlit import StreamlitHandoff
home = st.Page("pages/home.py", title="Home", default=True)
admin = st.Page("pages/admin.py", title="Admin", url_path="admin")
navigation = st.navigation([home, admin])
client = HandoffClient.from_config(st.secrets["floagent"])
auth = StreamlitHandoff(
client,
redirect_pages={
"/": home,
"/admin": admin,
},
service_name="Mera",
)
session = auth.require_session()
auth.render_sidebar(session)
navigation.run()
Configure the app with a known API base URL:
[floagent]
api_base_url = "https://api.example.com"
allowed_api_base_urls = ["https://api-alt.example.com"]
request_timeout_seconds = 10
Incoming api_base_url values and session-discovered endpoints must match the
configured URL or an explicit allowlist entry. This protects server-side apps
from making authentication requests to attacker-controlled destinations.
Register the external app with FloAgent using the Streamlit app root as its
handoff_url. Redirect paths must be listed in redirect_pages. Redirect
query parameters such as task_id are restored after page switching.
Set service_name when the host product uses a different user-facing brand;
package and protocol names remain unchanged.
Access and refresh tokens are kept in Streamlit Session State and are never written to browser storage. When the browser session is lost, the user must reopen or refresh the app through the FloAgent launcher to obtain a new one-time handoff.
Core client
Framework integrations can use HandoffClient directly:
from floagent_sdk import HandoffClient
client = HandoffClient("https://api.example.com")
session = client.exchange(token, api_base_url=discovered_api_base_url)
if session.needs_refresh():
session = client.refresh(session)
The client exchanges POST /auth/login/handoff/exchange tokens and refreshes
sessions through POST /auth/token/refresh. Tokens are never included in SDK
error messages.
Development
python -m pip install -e ".[test,streamlit]"
python -m pytest
python -m pip wheel --no-deps --wheel-dir dist .
See CONTRIBUTING.md for the contribution workflow and SECURITY.md for private vulnerability reporting.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file floagent_sdk-0.1.1.tar.gz.
File metadata
- Download URL: floagent_sdk-0.1.1.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0decfe2fcef388d51e68fd023780254ef6ec5f2ccb9d3edb173d7845ec5794f
|
|
| MD5 |
9c00681a548d23927de4bf9d6a3788e5
|
|
| BLAKE2b-256 |
2274671d29715ec1357a46df1ef67c880adb24f808ba20f9d7937c942540fe9c
|
Provenance
The following attestation bundles were made for floagent_sdk-0.1.1.tar.gz:
Publisher:
release.yml on flordaweave/floagent-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
floagent_sdk-0.1.1.tar.gz -
Subject digest:
e0decfe2fcef388d51e68fd023780254ef6ec5f2ccb9d3edb173d7845ec5794f - Sigstore transparency entry: 2495190226
- Sigstore integration time:
-
Permalink:
flordaweave/floagent-python@0b379fd01f9445ac34dfac09a687fc4446bd0c46 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/flordaweave
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0b379fd01f9445ac34dfac09a687fc4446bd0c46 -
Trigger Event:
push
-
Statement type:
File details
Details for the file floagent_sdk-0.1.1-py3-none-any.whl.
File metadata
- Download URL: floagent_sdk-0.1.1-py3-none-any.whl
- Upload date:
- Size: 10.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebe6eb18d0a66f9a7c91017a41cb074242ea110c9c5d9783f96ab1862dc13531
|
|
| MD5 |
2d1cc9ce383741f829418c2f3eaef537
|
|
| BLAKE2b-256 |
9f75c2a51ec4a1e89f2732269b0df52dc9c76f87a95c50d9c8fb89ada6b789a0
|
Provenance
The following attestation bundles were made for floagent_sdk-0.1.1-py3-none-any.whl:
Publisher:
release.yml on flordaweave/floagent-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
floagent_sdk-0.1.1-py3-none-any.whl -
Subject digest:
ebe6eb18d0a66f9a7c91017a41cb074242ea110c9c5d9783f96ab1862dc13531 - Sigstore transparency entry: 2495190234
- Sigstore integration time:
-
Permalink:
flordaweave/floagent-python@0b379fd01f9445ac34dfac09a687fc4446bd0c46 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/flordaweave
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@0b379fd01f9445ac34dfac09a687fc4446bd0c46 -
Trigger Event:
push
-
Statement type: