Api

class composapy.key.api.Key

Key static wrapper for the PropertyService contract. It is used to service user-level operations on a service-level library.

from composapy.key.api import Key
static get(key_id: int = None, name: str = None) KeyObject

Used to retrieve a key available to the currently registered session; takes either a key_id or name, but not both.

key_object = Key.get(key_id=123456)
key_object = Key.get(name="fuzzy pandas database connection key")
Parameters:
  • key_id – Composable key id

  • name – Name of the key. Raises an error if no results or more than one result are found.

static search(name: str, index_start: int = 0, number_results: int = 10) List[KeyObject]

Used to retrieve keys available to the user from the currently registered session. Each key result must be decoded, which is an expensive process. Limiting the number of results and skipping through paged results can reduce the search time. As an example, if there are 30 results, index_start is set to 9 and number_results set to 10, this will return results index 9 through 19.

key_object = Key.search("common key name")
key_object = Key.search("common key name", 10, 15)
Parameters:
  • name – Name of the key.

  • index_start – Starting index of the results to return.

  • number_results – Number of results to return.