Home

Tenyks

You can use the Tenyks SDK client to authenticate and manage your workspaces and datasets.

authenticate_with_api_key

authenticate_with_api_key ( api_base_url , api_key , api_secret , workspace_name ) classmethod

Authenticate using an API key.

Parameters:

NameTypeDescriptionDefault
api_base_urlstrThe base URL of the Tenyks API.required
api_keystrThe API key provided for authentication.required
api_secretstrThe API secret corresponding to the API key.required
workspace_namestrThe name of the workspace to use after authentication.required

Returns:

NameTypeDescription
TenyksAn instance of the Tenyks class.

authenticate_with_login

authenticate_with_login ( api_base_url , username , password , workspace_name ) classmethod

Authenticate using a username and password.

Parameters:

NameTypeDescriptionDefault
api_base_urlstrThe base URL of the Tenyks API.required
usernamestrThe username for authentication.required
passwordstrThe password for authentication.required
workspace_namestrThe name of the workspace to use after authentication.required

Returns:

NameTypeDescription
TenyksAn instance of the Tenyks class.

create_dataset

create_dataset ( name , images_location = None , metadata_location = None )

Create a new dataset in the current workspace.

Parameters:

NameTypeDescriptionDefault
namestrThe name of the new dataset.required
images_locationOptional [ Union [ AWSLocation , GCSLocation , AzureLocation ]]The location of the dataset's images. Defaults to None.None
metadata_locationOptional [ Union [ AWSLocation , GCSLocation , AzureLocation ]]The location of the dataset's metadata. Defaults to None.None

Returns:

NameTypeDescription
DatasetDataset The created Dataset object.

create_workspace

create_workspace ( name )

Create a new workspace.

Parameters:

NameTypeDescriptionDefault
namestrThe name of the new workspace.required

Returns:

NameTypeDescription
WorkspaceWorkspace The created Workspace object.

delete_dataset

delete_dataset ( key )

Delete a dataset by its key.

Parameters:

NameTypeDescriptionDefault
keystrThe key of the dataset to delete.required

get_dataset

get_dataset ( key )

Retrieve a specific dataset by its key.

Parameters:

NameTypeDescriptionDefault
keystrThe key of the dataset to retrieve.required

Returns:

NameTypeDescription
DatasetDataset The Dataset object corresponding to the specified key.

get_dataset_names

get_dataset_names ()

Retrieve the names of datasets in the current workspace.

Returns:

TypeDescription
List [str]List[str]: A list of dataset names available in the workspace.

get_datasets

get_datasets ()

Retrieve a list of datasets in the current workspace.

Returns:

TypeDescription
List [ Dataset ]List[Dataset]: A list of Dataset objects available in the workspace.

get_workspace

get_workspace ( id )

Retrieve a specific workspace by its ID.

Parameters:

NameTypeDescriptionDefault
idstrThe ID of the workspace to retrieve.required

Returns:

NameTypeDescription
WorkspaceWorkspace The Workspace object corresponding to the specified ID.

get_workspaces

get_workspaces ( page = 1 , page_size = 10 )

Retrieve a list of workspaces accessible to the user.

Parameters:

NameTypeDescriptionDefault
pageintThe page number for paginated results. Defaults to 1.1
page_sizeintThe number of workspaces to retrieve per page. Defaults to 10.10

Returns:

TypeDescription
List [ Workspace ]List[Workspace]: A list of Workspace objects accessible to the user.

set_workspace

set_workspace ( workspace_key , verbose = True )

Set the active workspace.

Parameters:

NameTypeDescriptionDefault
workspace_keystrThe key of the workspace to set as active.required
verboseOptional [bool]Whether to log the change of workspace. Defaults to True.True