User Operations
Python platform client for interacting with the Deci platform.
Deci's Platform client allows you to perform basic and advanced use-cases through the Deci platform. This lets you, through python code, create and manage your models, workspaces, experiments, and more.
DeciPlatformClient(proxy_headers=None, logger=None)
Attributes:
Name | Type | Description |
---|---|---|
raw_api |
PlatformApi
|
This is a low-level interface to the platform. Shouldn't be used directly. |
In order to use the client, you need to login to the platform. To do so, you'll need to set the following environment variables:
DECI_CLIENT_ID
: The user's client ID generated in the Deci platform.DECI_CLIENT_SECRET
: The user's secret generated in the Deci platform.DECI_WORKSPACE_ID
: Optional desired workspace ID to use upon a successful login. If not specified, the client will use the first workspace retrieved. The workspace ID should be retrieved from the platform here
Parameters:
Name | Type | Description | Default |
---|---|---|---|
proxy_headers |
Optional[dict[str, Any]]
|
A dictionary containing headers that will be sent to the proxy ( |
None
|
logger |
Optional[Logger]
|
An optional logger to use. If not specified, a default logger will be used. |
None
|
Source code in deci_platform_client/client/deci_platform_client.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
login(client_id, secret)
Login to the platform.
Tip
This method is called implicitly when you instantiate the client and specify the environment variables:
DECI_CLIENT_ID
DECI_CLIENT_SECRET
If you haven't done so, you'll need to call this method manually. You can generate the client ID and secret from your platform account
Parameters:
Name | Type | Description | Default |
---|---|---|---|
client_id |
str
|
The user's client ID generated in the Deci platform. |
required |
secret |
str
|
The user's secret generated in the Deci platform. |
required |
Source code in deci_platform_client/client/deci_platform_client.py
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
logout()
Log out from the Deci platform (Disposes the credentials).
Source code in deci_platform_client/client/deci_platform_client.py
137 138 139 140 |
|