Tenyks
You can use Tenyks SDK client to authenticate and manage your workspaces and datasets.
authenticate_with_api_key(api_base_url, api_key, api_secret, workspace_name)
classmethod
Authenticate using an API key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_base_url |
str
|
The base URL of the Tenyks API. |
required |
api_key |
str
|
The API key provided for authentication. |
required |
api_secret |
str
|
The API secret corresponding to the API key. |
required |
workspace_name |
str
|
The name of the workspace to use after authentication. |
required |
Returns:
Name | Type | Description |
---|---|---|
Tenyks |
An instance of the Tenyks class. |
authenticate_with_login(api_base_url, username, password, workspace_name)
classmethod
Authenticate using a username and password.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
api_base_url |
str
|
The base URL of the Tenyks API. |
required |
username |
str
|
The username for authentication. |
required |
password |
str
|
The password for authentication. |
required |
workspace_name |
str
|
The name of the workspace to use after authentication. |
required |
Returns:
Name | Type | Description |
---|---|---|
Tenyks |
An instance of the Tenyks class. |
create_dataset(name, images_location=None, metadata_location=None)
Create a new dataset in the current workspace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the new dataset. |
required |
images_location |
Optional[Union[AWSLocation, GCSLocation, AzureLocation]]
|
The location of the dataset's images. Defaults to None. |
None
|
metadata_location |
Optional[Union[AWSLocation, GCSLocation, AzureLocation]]
|
The location of the dataset's metadata. Defaults to None. |
None
|
Returns:
Name | Type | Description |
---|---|---|
Dataset |
Dataset
|
The created Dataset object. |
create_workspace(name)
Create a new workspace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name |
str
|
The name of the new workspace. |
required |
Returns:
Name | Type | Description |
---|---|---|
Workspace |
Workspace
|
The created Workspace object. |
delete_dataset(key)
Delete a dataset by its key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
The key of the dataset to delete. |
required |
get_dataset(key)
Retrieve a specific dataset by its key.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
key |
str
|
The key of the dataset to retrieve. |
required |
Returns:
Name | Type | Description |
---|---|---|
Dataset |
Dataset
|
The Dataset object corresponding to the specified key. |
get_dataset_names()
Retrieve the names of datasets in the current workspace.
Returns:
Type | Description |
---|---|
List[str]
|
List[str]: A list of dataset names available in the workspace. |
get_datasets()
Retrieve a list of datasets in the current workspace.
Returns:
Type | Description |
---|---|
List[Dataset]
|
List[Dataset]: A list of Dataset objects available in the workspace. |
get_workspace(id)
Retrieve a specific workspace by its ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
id |
str
|
The ID of the workspace to retrieve. |
required |
Returns:
Name | Type | Description |
---|---|---|
Workspace |
Workspace
|
The Workspace object corresponding to the specified ID. |
get_workspaces(page=1, page_size=10)
Retrieve a list of workspaces accessible to the user.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
page |
int
|
The page number for paginated results. Defaults to 1. |
1
|
page_size |
int
|
The number of workspaces to retrieve per page. Defaults to 10. |
10
|
Returns:
Type | Description |
---|---|
List[Workspace]
|
List[Workspace]: A list of Workspace objects accessible to the user. |
set_workspace(workspace_key, verbose=True)
Set the active workspace.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
workspace_key |
str
|
The key of the workspace to set as active. |
required |
verbose |
Optional[bool]
|
Whether to log the change of workspace. Defaults to True. |
True
|