pysepal.solara.session_manager.SessionManager#
- class pysepal.solara.session_manager.SessionManager[source]#
A singleton session manager for solara-sepal applications.
This class manages the lifecycle of sessions across different Solara applications, providing a centralized way to handle session creation, retrieval, and cleanup for GEE interfaces, SepalClient and GDriveInterface.
Note: Do not instantiate this class directly. Use the @with_sepal_sessions decorator or the utility functions in sepal_ui.solara.utils instead.
Initialize the SessionManager singleton instance.
Methods
Initialize the SessionManager singleton instance.
Clean up a session for the given kernel ID.
Create a new session with all the interfaces for the given kernel ID.
Get the current kernel ID.
Get a specific component from a session.
Get session information for a specific kernel.
Check if the SessionManager has been initialized.
Get all active sessions.
- SessionManager.cleanup_session(kernel_id)[source]#
Clean up a session for the given kernel ID.
- Parameters:
kernel_id (str) – The kernel ID to clean up.
- Return type:
None
- SessionManager.create_session(module_name='default')[source]#
Create a new session with all the interfaces for the given kernel ID.
- Parameters:
kernel_id – The kernel ID to create session for. If None, uses current kernel.
module_name (str) – The module name for the SepalClient.
- Raises:
EEClientError – For authentication-related errors.
Exception – For other validation or connection errors.
- Return type:
None
- SessionManager.get_session_component(component_name, kernel_id=None)[source]#
Get a specific component from a session.
- Parameters:
component_name (str) – The name/key of the component to retrieve.
kernel_id (str | None) – The kernel ID to get component from. If None, uses current kernel.
- Returns:
The component instance or None if not found.
- Return type:
Any | None
- SessionManager.get_session_info(kernel_id=None)[source]#
Get session information for a specific kernel.
- Parameters:
kernel_id (str | None) – The kernel ID to get info for. If None, uses current kernel.
- Returns:
Dictionary with session information.
- Return type:
dict