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 benchling: Benchling¶

Return a Benchling instance for the App.

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.

property id: str¶

Return the app tenanted installation id.