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.
Metadata
Release files for floagent-sdk 0.1.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 | Actions |
|---|---|---|---|---|
| floagent_sdk-0.1.1.tar.gz | 14.0 kB | With provenance | Details for floagent_sdk-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| floagent_sdk-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for floagent_sdk-0.1.1-py3-none-any.whl |
Total release size: 24.7 kB
Release files / floagent_sdk-0.1.1.tar.gz
| Download URL | floagent_sdk-0.1.1.tar.gz |
|---|---|
| Size | 14.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0decfe2fcef388d51e68fd023780254ef6ec5f2ccb9d3edb173d7845ec5794f
|
|
BLAKE2b-256 checksum How to use checksums |
2274671d29715ec1357a46df1ef67c880adb24f808ba20f9d7937c942540fe9c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logRelease files / floagent_sdk-0.1.1-py3-none-any.whl
| Download URL | floagent_sdk-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ebe6eb18d0a66f9a7c91017a41cb074242ea110c9c5d9783f96ab1862dc13531
|
|
BLAKE2b-256 checksum How to use checksums |
9f75c2a51ec4a1e89f2732269b0df52dc9c76f87a95c50d9c8fb89ada6b789a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logSecurity for floagent-sdk 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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for floagent_sdk-0.1.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 17, 2026.
Transparency logA 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.