status_elements

Widgets with notification queueing for Streamlit.

class streamlit_notify.status_elements.RerunnableStatusElement(base_widget)[source]

Bases: object

A wrapper for Streamlit widgets to enable notification queueing.

Initialize the wrapper.

Parameters:

base_widget (Callable[[...], Any])

__init__(base_widget)[source]

Initialize the wrapper.

Parameters:

base_widget (Callable[[...], Any])

Return type:

None

property session_state_key: str

Get the session state key for the notification queue.

property base_widget: Callable[[...], Any]

Get the base widget function.

property name: str

Get the name of the base widget.

property notifications: NotificationPriorityQueue

Get the notification queue.

setup_queue()[source]

Ensure the notification queue is set up in session state.

Return type:

None

__call__(*args, **kwargs)[source]

Add a notification to the queue.

Parameters:
Return type:

None

create_notification(*args, **kwargs)[source]

Create a notification without adding it to the queue.

Parameters:
Return type:

StatusElementNotification

notify(remove=True, priority=None, priority_type='eq')[source]

Display all queued notifications.

Parameters:
  • remove (bool)

  • priority (int | None)

  • priority_type (Literal['le', 'lt', 'ge', 'gt', 'eq'])

Return type:

None

__repr__()[source]

String representation of the wrapper.

Return type:

str

__str__()[source]

String representation of the wrapper.

Return type:

str