imednet_streamlit package

Streamlit dashboard plugin for iMednet.

This package provides a comprehensive, multi-tenant clinical data dashboard built with Streamlit. It includes components for data visualization, longitudinal lineage tracking, and workflow management.

Subpackages

Submodules

imednet_streamlit.app module

Streamlit application entry point.

This module configures the main dashboard UI, including accessibility features, security sanitization for Streamlit messages, and the multi-page navigation structure.

imednet_streamlit.app.secure_st_error(body, *args, **kwargs)[source]

Render a sanitized error message.

Return type:

Any

Parameters:
  • body (Any) –

  • args (Any) –

  • kwargs (Any) –

imednet_streamlit.app.secure_st_exception(exception, *args, **kwargs)[source]

Render a sanitized exception trace.

Return type:

Any

Parameters:
  • exception (Any) –

  • args (Any) –

  • kwargs (Any) –

imednet_streamlit.app.secure_st_info(body, *args, **kwargs)[source]

Render a sanitized info message.

Return type:

Any

Parameters:
  • body (Any) –

  • args (Any) –

  • kwargs (Any) –

imednet_streamlit.app.secure_st_warning(body, *args, **kwargs)[source]

Render a sanitized warning message.

Return type:

Any

Parameters:
  • body (Any) –

  • args (Any) –

  • kwargs (Any) –

imednet_streamlit.app.toggle_high_contrast()[source]

Toggle the high contrast accessibility mode in session state and URL params.

Return type:

None

imednet_streamlit.auth module

Authentication and multi-tenant session management for Streamlit.

This module provides integration with corporate SSO, study-based credential discovery from an enterprise tenant database, and SDK lifecycle management within the Streamlit session state.

imednet_streamlit.auth.clear_credentials()[source]

Remove all authentication state from Streamlit session storage.

This removes the cached SDK instance, connection flag, and any credential input values currently held in st.session_state.

Return type:

None

imednet_streamlit.auth.get_db_path()[source]

Resolve the database file path based on the selected environment.

Return type:

str

imednet_streamlit.auth.render_auth_sidebar()[source]

Render sidebar authentication controls and update session auth state.

Return type:

bool

Returns:

True when a valid SDK connection is active in st.session_state; otherwise False.

imednet_streamlit.cli module

CLI commands for iMednet Streamlit dashboard.

imednet_streamlit.cli.run_dashboard(port=8501, no_browser=False)[source]

Launch the interactive iMednet Streamlit reporting dashboard.

Return type:

None

Parameters:
  • port (int) –

  • no_browser (bool) –

imednet_streamlit.cli.setup_parser(subparsers)[source]

Set up the dashboard argparse subparsers.

Return type:

None

Parameters:

subparsers (_SubParsersAction) –

imednet_streamlit.credentials module

Thread-safe credential management repository.

class imednet_streamlit.credentials.CredentialRepository[source]

Bases: object

Manages secure access to tenant credentials in a local SQLite database.

__init__(db_path)[source]

Initialize the repository with a path to the database.

Parameters:

db_path (str) – The filesystem path to the SQLite database.

get_credentials(study_key)[source]

Retrieve credentials for a given study key.

Parameters:

study_key (str) – The study key to lookup.

Return type:

tuple[Optional[str], Optional[str], Optional[str]]

Returns:

A tuple of (api_key, security_key, env_url), or (None, None, None) if not found.

get_provisioned_studies()[source]

Get a list of all provisioned study keys.

Return type:

list[str]

Returns:

A list of study keys.

provision_tenant(study_key, api_key, security_key, env_url=None)[source]

Provision or update credentials for a tenant.

Parameters:
  • study_key (str) – The study key identifier.

  • api_key (str) – The API key for the tenant.

  • security_key (str) – The security key for the tenant.

  • env_url (Optional[str]) – Optional base URL for the tenant’s environment.

Return type:

None

imednet_streamlit.utils module

Utility functions for Streamlit components.

imednet_streamlit.utils.models_to_frame(models, *, date_column=None)[source]

Convert a sequence of models into a pandas DataFrame.

Return type:

DataFrame

Parameters:
  • models (Sequence[Any]) –

  • date_column (str | None) –