benchling_sdk.apps.framework module¶
- class App¶
Bases:
object
App.
See https://docs.benchling.com/docs/getting-started-benchling-apps
Accepts providers as arguments to lazily initialize since some required attributes may not be known until runtime. Also allows for easier mocking in tests.
- __init__(app_id: str, benchling: Benchling, config_store: Optional[ConfigItemStore] = None) None ¶
Initialize a Benchling App.
- Parameters
app_id â An id representing a tenanted app installation (e.g., âapp_Uh3BZ55aYcXGFJVbâ)
benchling â A Benchling object for making API calls. The auth_method should be valid for the specified App. Commonly this is ClientCredentialsOAuth2 using the appâs client ID and client secret.
config_store â The configuration item store for accessing an Appâs tenanted app config items. If unspecified, will default to retrieving app config from the tenant referenced by Benchling. Apps that donât use app configuration can safely ignore this.
- property config_store: ConfigItemStore¶
Return a ConfigItemStore instance for the App.
- continue_session_context(session_id: str, context_enter_handler: Optional[SessionContextEnterHandler] = None, context_exit_handler: Optional[SessionContextExitHandler] = None) SessionContextManager ¶
Continue Session Context.
Fetch an existing app session from Benchling and enter a context with it.
- create_session_context(name: str, timeout_seconds: int, context_enter_handler: Optional[SessionContextEnterHandler] = None, context_exit_handler: Optional[SessionContextExitHandler] = None) SessionContextManager ¶
Create Session Context.
Create a new app session in Benchling.