kumoai.init

Contents

kumoai.init#

kumoai.init(url=None, api_key=None, snowflake_credentials=None, snowflake_application=None, log_level='INFO', group=None, project=None)[source]#

Initializes and authenticates the API key against the Kumo service. Successful authentication is required to use the SDK.

Example

>>> import kumoai
>>> kumoai.init(url="<api_url>", api_key="<api_key>")  
Parameters:
  • url (Optional[str]) – The Kumo API endpoint. Can also be provided via the KUMO_API_ENDPOINT envronment variable. Will be inferred from the provided API key, if not provided.

  • api_key (Optional[str]) – The Kumo API key. Can also be provided via the KUMO_API_KEY environment variable.

  • snowflake_credentials (Optional[Dict[str, str]]) – The Snowflake credentials to authenticate against the Kumo service. For SPCS only. Either password-based: {"user", "password", "account"}, or key-pair: {"user", "private_key", "account"} with optional "private_key_passphrase" for encrypted keys. The private key should be PEM format (same as used for connector auth in the UI).

  • snowflake_application (Optional[str]) – The Snowflake application.

  • log_level (str) – The logging level that Kumo operates under. Defaults to INFO; for more information, please see set_log_level. Can also be set with the environment variable KUMOAI_LOG.

  • group (Optional[str]) – The group to operate in. Only applicable when RBAC is enabled. Can be a group name or ID. If the user belongs to only one group, it will be auto-selected even if not provided.

  • project (Optional[str]) – The project to operate in. Only applicable when RBAC is enabled. Can be a project name or ID. Requires group to be resolvable.

Return type:

None