schrodinger.application.livedesign.ld_import_utils module

class schrodinger.application.livedesign.ld_import_utils.LDLoginInfo(host, refresh_token, username, password)

Bases: tuple

host

Alias for field number 0

password

Alias for field number 3

refresh_token

Alias for field number 1

username

Alias for field number 2

schrodinger.application.livedesign.ld_import_utils.ask_disconnect_active_connection() bool

Warn the user about an incompatible login. :return: True if the user wants to disconnect, False otherwise.

schrodinger.application.livedesign.ld_import_utils.ensure_user_is_logged_in(username: str, host: str) bool

Ensure that the user is logged in to the given host. :param username: The username to be used for authentication. :param host: The host to be used for authentication.

Returns

True if the user is logged in, False otherwise.

schrodinger.application.livedesign.ld_import_utils.get_credentials_for_livedesign_request(username: str, host: str) List[str]

Get the credentials for a LiveDesign request for a particular host and username. It can return either combination of username and password or refresh token based on how user chooses to authenticate.

Parameters
  • username – The username to be used for authentication.

  • host – The host to be used for authentication.

Returns

A list of credentials to be used for the request.

schrodinger.application.livedesign.ld_import_utils.get_ldclient(ld_login_info: schrodinger.application.livedesign.ld_import_utils.LDLoginInfo) schrodinger.application.livedesign.ldclient_proxy.LDClientProxy

Downloads and installs ldclient from the ld_login_info and cleans up the download directory once the context is exited. It yields the LDClientProxy object. This should not be used if there already exists a livedesign connection.

Parameters

ld_login_info – is the login info to be used to create the ldclient.

Returns

the ldclient proxy object

schrodinger.application.livedesign.ld_import_utils.get_attachment_ids(live_report_id: str, report_level: str, column_ids: List[str], row_keys: List[str])

Returns list of attachment ids for given live report, at report level for column ids and row keys.

Parameters
  • live_report_id – is the live report id to be used for structure search.

  • report_level – is the report level to be used.

  • column_ids – Column IDs to limit the search to.

  • row_keys – is the list of row keys to be used.

schrodinger.application.livedesign.ld_import_utils.generate_structure_file_via_ldclient(live_report_id: str, report_level: str, column_ids: List[str], row_keys: List[str], structure_file_path: str)

Creates structure file with structures from the LD server via LDClient for given attachment ids.

Parameters
  • live_report_id – is the live report id to be used.

  • report_level – is the report level to be used.

  • column_ids – is the list of column ids to be used.

  • row_keys – is the list of row keys to be used.

  • structure_file_path – is the path to the file where structure needs to be written.