anatools.anaclient.anaclient module¶
The client module is used for connecting to Rendered.ai’s Platform API.
- exception AuthFailedError¶
Bases:
Exception
- class client(workspaceId=None, environment='prod', email=None, password=None, APIKey=None, local=False, interactive=True, verbose=None)¶
Bases:
object
- add_organization_member(email, role, organizationId=None)¶
Add a user to an existing organization.
- Parameters
email (str) – Email of user to add.
role (str) – Role for user.
organizationId (str) – Organization ID to add members too. Uses current if not specified.
- Returns
Response status if user got added to workspace succesfully.
- Return type
str
- build_managed_channel(channelfile)¶
Build the Docker image of a channel.
- Parameters
channelfile (str) – The channel file for the channel to build.
- Returns
A boolean that indicates if the channel Docker image was successfully built.
- Return type
bool
- cancel_dataset(datasetId, workspaceId=None)¶
Stop a running job.
- Parameters
datasetId (str) – Dataset ID of the running job to stop.
workspaceId (str) – Workspace ID of the running job. If none is provided, the default workspace will get used.
- Returns
Success or error message about stopping the job execution.
- Return type
str
- check_logout()¶
- create_analytics(datasetId, type, range=[], images=True, workspaceId=None)¶
Generate analytics for a dataset.
- Parameters
datasetId (str) – Dataset ID to download image annotation for.
type (str) – The type of analytics to generate. Choose one from the list that get_analytics_types method returns.
range (list[int]) – The range of runs to generate analytics for.
images (bool) – If true, images specific to the analytics type will be created along with metrics data.
workspaceId (str) – Workspace ID of the dataset to generate the analytics for. If none is provided, the current workspace will get used.
- Returns
The analyticsId for the analytics job.
- Return type
str
- create_annotation(datasetId, format, map, workspaceId=None)¶
Generates annotations for an existing dataset.
- Parameters
datasetId (str) – Dataset ID to generate annotation for.
format (str) – Annotation format. Call get_annotation_formats() to find supported formats.
map (str) – The map file used for annotations. Call get_annotation_maps() to find supported maps.
workspaceId (str) – Workspace ID of the dataset to generate annotation for. If none is provided, the current workspace will get used.
- Returns
The annotationsId for the annotation job.
- Return type
str
- create_api_key(name, expires=None, organizationId=None)¶
- Creates a new API Key for the user account for the current organization. User will only see this key once, so make sure to save it.
To use the api key on login, ensure it is set as an environment variable called RENDEREDAI_API_KEY on next use of anatools or send it as an init parameter called APIKey. This call can only be used when logged in with email/password.
- Parameters
name (str) – Name of the API Key.
organizationId (str) – Organization ID to set the API Key access at. If no organization is provided, it will use the current context.
expires (str) – Expiration date to set for the API Key. If none provided, a default expiration a week out will get set.
- Returns
API Key in plain-text or failure message about API key creation
- Return type
str
- create_dataset(name, graphId, description='', runs=1, priority=1, seed=1, workspaceId=None)¶
Create a new dataset based off an existing staged graph. This will start a new job.
- Parameters
name (str) – Name for dataset.
graphId (str) – ID of the staged graph to create dataset from.
description (str) – Description for new dataset.
runs (int) – Number of times a channel will run within a single job. This is also how many different images will get created within the dataset.
priority (int) – Job priority.
seed (int) – Seed number.
workspaceId (str) – Workspace ID of the staged graph’s workspace. If none is provided, the current workspace will get used.
- Returns
Success or failure message about dataset creation.
- Return type
str
- create_gan_dataset(modelId, datasetId, workspaceId=None)¶
Create a new GAN dataset based off an existing dataset. This will start a new job.
- Parameters
modelId (str) – Model ID to use for the GAN.
datasetId (str) – Dataset ID to input into the GAN.
workspaceId (str) – Workspace ID where the dataset exists.
- Returns
The datsetId for the GAN Dataset job.
- Return type
str
- create_inpaint(volumeId, location, files=[], destination=None)¶
Creates an inpaint job.
- Parameters
volumeId (str) – Volume ID
location (str) – Directory location of the input files
files (list) – List of files to inpaint, leave empty to inpaint all files in directory
destination (str) – Destination of the inpaint
- Returns
Inpaint ID
- Return type
str
- create_llm_prompt(prompt, baseChannel, nodeType, nodeName)¶
Creates an LLM prompt.
- Parameters
prompt (str) – The prompt to create
baseChannel (str) – The base channel to use for examples
nodeType (str) – The type of node to create
nodeName (str) – The name of the node to create
- Returns
Prompt ID
- Return type
str
- create_managed_channel(name, description=None, organizationId=None, volumes=[], instance='p2.xlarge', timeout=120, interfaceVersion=1)¶
Create a managed channel for your organization.
- Parameters
name (str) – Channel name.
description (str) – Description of the channel
organizationId (str) – Organization ID. Defaults to current if not specified.
volumes (list[str]) – List of the data volume names to associate with this channel.
instance (str) – AWS Instance type.
timeout (int) – Maximum runtime of a channel run.
interface (int) – The ana interface version number.
- Returns
channel data
- Return type
list[dict]
- create_managed_gan(name, description, modelfile, flags=None, organizationId=None)¶
Uploades a GAN model to the microservice. The model will be owned by the specified organization. If organizationId is not given the model will be owned by that of the analcient.
- Parameters
name (str) – A name for model.
description (str) – Details about the model.
modelfile (str) – The file of the model - relative to the local directry.
flags (str) – Parameters for use when running the model.
organizationId (str) – Id of organization that owns the model, that of the anaclient if not given.
- Returns
modleId – The unique identifier for this model.
- Return type
str
- create_managed_map(name, description, mapfile, organizationId=None)¶
Uploades an annotation map to the microservice. The map will be owned by the specified organization. If not organizationId is given the model will be owned by that of the analcient.
- Parameters
name (str) – A name for map.
description (str) – Details about the map.
mapfile (str) – The map file - relative to the local directry.
organizationId (str) – Id of organization that owns the map, that of the anaclient if not given.
- Returns
mapId – The unique identifier for this map.
- Return type
str
- create_managed_volume(name, description=None, organizationId=None)¶
Creates a new volume with the specified name in the organization. By default the permission on the volume is set to write.
- Parameters
name (str) – The name of the new volume. Note: this name needs to be unique per organization.
description (str) – Description of the volume
organizationId (str) – The ID of the organization that the managed volume will belong to.
- Returns
volumeId
- Return type
str
- create_ml_inference(datasetId, modelId, mapId, workspaceId=None)¶
Create a new machine learning inference job.
- Parameters
datasetId (str) – Dataset ID
modelId (str) – Model ID
mapId (str) – Map ID
workspaceId (str) – Workspace ID
- Returns
Inference ID
- Return type
str
- create_ml_model(datasetId, architectureId, name, description, parameters, workspaceId=None)¶
Creates a new machine learning model.
- Parameters
architectureId (str) – Architecture ID
datasetId (str) – Dataset ID
name (str) – Model name
description (str) – Model description
paramters (str) – JSON string of model parameters
workspaceId (str) – Workspace ID
- Returns
Machine learning model ID
- Return type
str
- create_remote_development(channelId, organizationId=None, channelVersion=None)¶
Creates a remote development environment.
This method initiates a remote development session on the specified channel, optionally within a given organization. If no organizationId is provided, it defaults to the organization associated with the current user.
- Parameters
channelId (str) – The ID of the channel to use for creating the remote development session.
channelVersion (str, optional) – The version of the channel to use. If not provided, defaults to the latest version.
organizationId (str, optional) – The ID of the organization where the session will be created. If not provided, defaults to the user’s organization.
- Returns
A message indicating that the session is being created, along with a link to access the session.
- Return type
str
Notes
This function checks if the user is logged out before proceeding.
Calls ana_api.createRemoteDevelopment to initiate the session.
Displays a warning message indicating that the feature is experimental.
Example Output¶
⚠️ Warning: This feature is very experimental. Use with caution! ⚠️ 🚀 Your environment will be available here shortly: 🔗 <editorUrl> 🌐
- create_staged_graph(name, channelId, graph, description=None, workspaceId=None)¶
Generates a new staged graph based off provided parameters. Must provide valid json string to create a new staged graph.
- Parameters
name (str) – Name for the that will get generated.
channelId (str) – Id of channel to generate the staged graph with.
graph (str) – The graph as a dictionary or JSON string. While YAML files are used in channel development, the Platform SDK and API only support JSON. Ensure that the YAML file is valid in order for the yaml.safe_load to convert YAML to a dictionary for you. Otherwise, provide a graph in JSON format.
description (str) – Description of staged graph. Optional.
workspaceId (str) – Workspace ID create the staged graph in. If none is provided, the default workspace will get used.
- Returns
The staged graph id if it was created sucessfully or an error message.
- Return type
str
- create_umap(datasetIds, samples, workspaceId=None)¶
Creates a UMAP dataset comparison job on the platform.
- Parameters
datasetIds ([str]) – Dataset ID to retrieve information for.
samples ([int]) – Samples to take from each dataset.
workspaceId (str) – Workspace ID where the datasets exists.
- Returns
The UMAP Job ID.
- Return type
str
- create_workspace(name, channelIds=[], volumeIds=[], code=None)¶
Create a new workspace with specific channels.
- Parameters
name (str) – New workspace name.
channelIds (list[str]) – List of channel ids to add to workspace.
volumeIds (list[str]) – List of volume ids that the workspace will have access to.
code (str) – Content code that used for creating a workspace
- Returns
Workspace ID if creation was successful. Otherwise returns message.
- Return type
str
- delete_analytics(analyticsId, workspaceId=None)¶
Deletes a dataset’s analytics.
- Parameters
analyticsId (str) – Analytics ID for the analytics to delete.
workspaceId (str) – Workspace ID where the analytics exist. If none is provided, the current workspace will get used.
- Returns
If true, successfully deleted the analytics.
- Return type
bool
- delete_annotation(annotationId, workspaceId=None)¶
Delete a dataset annotation.
- Parameters
annotationId (str) – AnnoationId of the annotation job.
workspaceId (str) – Workspace ID of the dataset to generate annotation for. If none is provided, the current workspace will get used.
- Returns
If true, successfully deleted the annotation.
- Return type
bool
- delete_api_key(name)¶
Deletes the API key from user account. This call can only be used when logged in with email/password.
- Parameters
name (str) – Name of the API Key to delete.
- Returns
Success or failure message about API key deletion
- Return type
bool
- delete_dataset(datasetId, workspaceId=None)¶
Delete an existing dataset.
- Parameters
datasetId (str) – Dataset ID of dataset to delete.
workspaceId (str) – Workspace ID that the dataset is in. If none is provided, the current workspace will get used.
- Returns
Success or failure message about dataset deletion.
- Return type
str
- delete_gan_dataset(datasetId, workspaceId=None)¶
Deletes a GAN dataset job.
- Parameters
datasetId (str) – Dataset ID for the GAN dataset.
workspaceId (str) – Workspace ID where the dataset exists.
- Returns
Returns true if the GAN dataset was successfully deleted.
- Return type
bool
- delete_gan_model(modelId)¶
Delete the GAN model and remove access to it from all shared organizations. This can only be done by a user in the organization that owns the model.
- Parameters
modelId (str) – The ID of a specific GAN model.
- Returns
Status
- Return type
str
- delete_inpaint(volumeId, inpaintId)¶
Deletes or cancels an inpaint job.
- Parameters
volumeId (str) – Volume ID
inpaintId (str) – Inpaint ID
- Returns
Success / Failure
- Return type
bool
- delete_llm_prompt(promptId)¶
Deletes an LLM prompt.
- Parameters
promptId (str) – The ID of a prompt.
- Returns
Success code
- Return type
bool
- delete_managed_channel(channelId)¶
Delete a managed channel of your organization.
- Parameters
channelId (str) – Id of channel to delete.
- Returns
Status
- Return type
str
- delete_managed_gan(modelId)¶
Removes the managed map
- Parameters
modelId (str) – The ID of a specific Model to delete.
- Returns
Status
- Return type
bool
- delete_managed_map(mapId)¶
Removes the managed map
- Parameters
mapId (str) – The ID of a specific Map to delete.
- Returns
Status
- Return type
bool
- delete_managed_volume(volumeId)¶
Removes the volume from the organization. Note that this will delete any remote data in the volume and channels that rely on this volume will need to be updated.
- Parameters
volumeId (str) – The ID of a specific Volume to delete.
- Returns
Status
- Return type
str
- delete_ml_inference(inferenceId, workspaceId=None)¶
Deletes or cancels a machine learning inference job.
- Parameters
inferenceId (str) – Inference ID
workspaceId (str) – Workspace ID
- Returns
Success / failure
- Return type
bool
- delete_ml_model(modelId, workspaceId=None)¶
Deletes or cancels a machine learning model.
- Parameters
modelId (str) – Model ID
workspaceId (str) – Workspace ID
- Returns
Success / failure
- Return type
bool
- delete_remote_development(editorSessionId, organizationId=None)¶
Deletes a remote development session.
This method removes a specific editor session, optionally within a given organization. If no organizationId is provided, it defaults to the organization associated with the current user.
- Parameters
editorSessionId (str) – The ID of the editor session to be deleted.
organizationId (str, optional) – The ID of the organization where the editor session is running. If not provided, defaults to the user’s organization.
- Returns
A dictionary representing the result of the session deletion, or session details upon deletion.
- Return type
dict
Notes
This function checks if the user is logged out before proceeding.
Calls ana_api.deleteRemoteDevelopment to perform the deletion.
- delete_staged_graph(graphId, workspaceId=None)¶
Delete a staged graph in a workspace.
- Parameters
graphId (str) – Staged Graph id to delete.
workspaceId (str) – Workspace ID of the staged graph’s workspace. If none is provided, the current workspace will get used.
- Returns
A success or error message based on staged graph’s delete.
- Return type
str
- delete_umap(umapId, workspaceId=None)¶
Deletes/cancels a UMAP dataset comparison on the platform.
- Parameters
umapId (str) – UMAP Job ID.
workspaceId (str) – Workspace ID where the datasets exists.
- Returns
Status.
- Return type
bool
- delete_volume_data(volumeId, files=[])¶
Delete data from a volume.
- Parameters
volumeId (str) – VolumeId to delete files from.
files (str) – The specific files to delete from the volume. If left empty, no files are deleted.
- Returns
Status
- Return type
str
- delete_workspace(workspaceId=None, prompt=True)¶
Delete an existing workspace.
- Parameters
workspaceId (str) – Workspace ID for workspace to get deleted. Deletes current workspace if not specified.
prompt (bool) – Set to True if avoiding prompts for deleting workspace.
- Returns
Success or failure message if workspace was sucessfully removed.
- Return type
str
- deploy_managed_channel(channelId=None, channelfile=None, image=None)¶
Deploy the Docker image of a channel.
- Parameters
channelId (str) – Channel ID that you are pushing the image to. If the channelId isn’t specified, it will use the image name to lookup the channelId.
channelfile (str) – Name of the channel file to look for.
image (str) – The Docker image name. This should match the channel name when running ana. If image is not specified, it will use the channel name for the channelId.
- Returns
deploymentId for current round of deployment or an error message if something went wrong
- Return type
str
- download_annotation(datasetId, annotationId, workspaceId=None)¶
Downloads annotations archive.
- Parameters
datasetId (str) – Dataset ID to download image annotation for.
annotationId (str) – Id of previously generated image annotation.
workspaceId (str) – Workspace ID of the dataset to generate annotation for. If none is provided, the current workspace will get used.
- Returns
The name of the archive file that got downloaded.
- Return type
str
- download_dataset(datasetId, workspaceId=None, localDir=None)¶
Download a dataset.
- Parameters
datasetId (str) – Dataset ID of dataset to download.
workspaceId (str) – Workspace ID that the dataset is in. If none is provided, the default workspace will get used.
localDir (str) – Path for where to download the dataset. If none is provided, current working directory will be used.
- Returns
Success or failure message about dataset download.
- Return type
str
- download_managed_gan(modelId, localDir=None)¶
Download the managed gan model file from your organization.
- Parameters
modelId (str) – ModelId to download.
localDir (str) – Path for where to download the gan model. If none is provided, current working directory will be used.
- Returns
The name of the managed gan model that got downloaded.
- Return type
str
- download_managed_map(mapId, localDir=None)¶
Download the managed annotation map file from your organization.
- Parameters
mapId (str) – MapId to download.
localDir (str) – Path for where to download the managed annotation map. If none is provided, current working directory will be used.
- Returns
The name of the managed map file that got downloaded.
- Return type
str
- download_ml_inference(inferenceId, localDir=None, workspaceId=None)¶
Download the inference detections.
- Parameters
inferencId (str) – Inference ID
localDir (str) – Local directory to save the model
workspaceId (str) – Workspace ID
- Returns
Success / failure
- Return type
bool
- download_ml_model(modelId, localDir=None, workspaceId=None)¶
Download the machine learning model.
- Parameters
modelId (str) – Model ID
localDir (str) – Local directory to save the model
workspaceId (str) – Workspace ID
- Returns
Success / failure
- Return type
bool
- download_staged_graph(graphId, workspaceId=None)¶
Download a staged graph.
- Parameters
graphId (str) – Graph ID of the staged graph to download.
workspaceId (str) – Workspace ID of the staged graph’s workspace. If none is provided, the default workspace will get used.
- Returns
A download URL that can be used in the browser or a failure message.
- Return type
str
- download_volume_data(volumeId, files=[], localDir=None, recursive=True, sync=False)¶
Download data from a volume.
- Parameters
volumeId (str) – VolumeId to download data of.
files (str) – The specific files or directories to retrieve from the volume, if you wish to retrieve all then leave the list empty.
localDir (str) – The location of the local directory to download the files to. If not specified, this will download the files to the current directory.
recursive (bool) – Recursively download files from the volume.
sync (bool) – Syncs data between the local directory and the remote location. Only creates folders in the destination if they contain one or more files.
- Returns
Status
- Return type
str
- edit_dataset(datasetId, description=None, name=None, workspaceId=None)¶
Update dataset description.
- Parameters
datasetId (str) – Dataset ID to update description for.
description (str) – New description.
name (str) – New name for dataset.
workspaceId (str) – Workspace ID of the dataset to get updated. If none is provided, the current workspace will get used.
- Returns
Success or failure message about dataset update.
- Return type
str
- edit_managed_channel(channelId, name=None, description=None, volumes=None, instance=None, timeout=None, status=None, interfaceVersion=None, preview=None)¶
Edit a managed channel for your organization.
- Parameters
channelId (str) – ChannelId ID of the channel to edit.
name (name) – The new name to give the channel.
description (str) – Description of the channel
volumes (list[str]) – Data volumes for the channel.
instance (str) – Instance type to run the channel on.
timeout (int) – Maximum runtime for the channel run.
status (str) – The status of the channel.
interface (int) – The ana interface version number.
preview (bool) – Enable or disable the preview for the channel.
- Returns
If true, the channel was successfully edited.
- Return type
bool
- edit_managed_gan(modelId, name=None, description=None, flags=None)¶
Edits the name, description, and flags of a managed gan.
- Parameters
modelId (str) – The modelId that will be updated.
name (str) – The new name of the managed gan. Note: this name needs to be unique per organization.
description (str) – Description of the managed gan
flags (str) – Flags for the model
- Returns
Status
- Return type
bool
- edit_managed_map(mapId, name=None, description=None)¶
Edits the name of a managed map.
- Parameters
mapId (str) – The mapId that will be updated.
name (str) – The new name of the managed map. Note: this name needs to be unique per organization.
description (str) – Description of the managed map
- Returns
Status
- Return type
bool
- edit_managed_volume(volumeId, name=None, description=None, permission=None)¶
Edits the volume in your current organization.
- Parameters
volumeId (str) – The volumeId that will be updated.
name (str) – The new name of the new volume. Note: this name needs to be unique per organization.
description (str) – Description of the volume
permission (str) – Permission to set for the volume. Choose from: read, write, or view.
- Returns
Status True or False
- Return type
str
- edit_ml_model(modelId, name, description, workspaceId=None)¶
Edit the name or description of a machine learning model.
- Parameters
modelId (str) – Model ID
name (str) – Model name
description (str) – Model description
workspaceId (str) – Workspace ID
- Returns
Success / failure
- Return type
bool
- edit_organization(name, organizationId=None)¶
Update the organization name. Uses current organization if no organizationId provided.
- Parameters
name (str) – Name to update organization to.
organizationId (str) – Organization Id to update.
- Returns
True if organization was edited successfully, False otherwise.
- Return type
bool
- edit_organization_member(email, role, organizationId=None)¶
Edit a member’s role.
- Parameters
email (str) – Member email to edit.
role (str) – Role to assign.
organizationId (str) – Organization ID to remove member from. Edits member in current organization if not specified.
- Returns
Response if member got edited succesfully.
- Return type
str
- edit_staged_graph(graphId, description=None, name=None, workspaceId=None)¶
Update staged graph description and name.
- Parameters
graphId (str) – Staged Graph id to update.
description (str) – New description to update.
name (str) – New name to update.
workspaceId (str) – Workspace ID of the staged graph’s workspace. If none is provided, the current workspace will get used.
- Returns
A success or error message based on staged graph’s update.
- Return type
str
- edit_workspace(name=None, channelIds=None, volumeIds=None, ganIds=None, mapIds=None, workspaceId=None)¶
Edit workspace information.
- Parameters
name (str) – New name to replace old one.
channelIds (list[str]) – Names of channels that the workspace will have access to.
volumeIds (list[str]) – List of volume ids that the workspace will have access to.
ganIds (list[str]) – List of GAN ids that the workspace will have access to.
mapIds (list[str]) – List of map ids that the workspace will have access to.
workspaceId (str) – Workspace ID for workspace to update.
- Returns
Success or failure message if workspace was sucessfully updated.
- Return type
bool
- get_analytics(analyticsId, workspaceId=None)¶
Retrieve information about a specific analytics job. If an analytics job is of type objectMetrics or meanBrightness, then images will get downloaded to current working directory.
- Parameters
analyticsId (str) – Analytics Job ID.
workspaceId (str) – Workspace ID where the analytics exist. If none is provided, the current workspace will get used.
- Returns
Analytics job information.
- Return type
list[dict]
- get_analytics_types()¶
Retrieve the analytics types available on the Platform.
- Returns
The analytics types available on the Platform.
- Return type
list[str]
- get_annotation_formats()¶
Retrieves the annotation formats supported by the Platform.
- Returns
The annotation formats supported by the Platform.
- Return type
str
- get_annotation_maps(organizationId=None, workspaceId=None, mapId=None)¶
Retrieves annotation maps.
- Parameters
organizationId (str) – Organization ID to retrieve maps for. If not specified then the current organization is used.
workspaceId (str) – Workspace ID to retrieve maps for. If not specified then the current workspace is used.
mapId (str) – Annotation map ID to retrieve
- Returns
The requested annotation maps.
- Return type
str
- get_annotations(datasetId=None, annotationId=None, workspaceId=None)¶
Retrieve information about existing annotations generated for a dataset. Querying requires both datasetId and annotationId.
- Parameters
datasetId (str) – Dataset ID to generate annotations for.
annotationId (str) – Annotation ID for a specific annotations job.
workspaceId (str) – Workspace ID where the annotations exist. If none is provided, the current workspace will get used.
- Returns
Annotation information.
- Return type
list[dict]
- get_api_key_data(name)¶
Returns information about specific api key. This call will return data only when logged in with email/password.
- Parameters
name (str) – Name of the API Key.
- Returns
Information about API Key
- Return type
[dict]
- get_api_keys()¶
Queries the api keys associated with user’s account. This call will return data only when logged in with email/password.
- Returns
Names of API keys associated with user’s account.
- Return type
[dict]
- get_channel_documentation(channelId, localDir=None)¶
Downloads a markdown file for channel documentation.
- Parameters
channelID (str) – The channelId of the channel
localDir (str) – The location to download the file to.
- Returns
The list of filenames downloaded.
- Return type
list[str]
- get_channels(organizationId=None, workspaceId=None, channelId=None)¶
Shows all channels available to the user. Can filter by organizationId, workspaceId, or channelId.
- Parameters
organizationId (str) – Filter channel list on what’s available to the organization.
workspaceId (str) – Filter channel list on what’s available to the workspace.
channelId (str) – Filter channel list on the specific channelId.
- Returns
List of channels associated with user, workspace, organization or channelId.
- Return type
list[dict]
- get_dataset_log(datasetId, runId, saveLogFile=False, workspaceId=None)¶
Shows dataset log information to the user.
- Parameters
datasetId (str) – The dataset the run belongs to.
runId (str) – The run to retrieve the log for.
saveLogFile (bool) – If True, saves log file to current working directory.
workspaceId (str) – The workspace the run belongs to.
- Returns
Get log information by runId
- Return type
list[dict]
- get_dataset_runs(datasetId, state=None, workspaceId=None)¶
Shows all dataset run information to the user. Can filter by state.
- Parameters
datasetId (str) – The dataset to retrieve logs for.
state (str) – Filter run list by status.
workspaceId (str) – The workspace the dataset is in.
- Returns
List of run associated with datasetId.
- Return type
list[dict]
- get_datasets(datasetId=None, name=None, email=None, workspaceId=None)¶
Queries the workspace datasets based off provided parameters. Checks on datasetId, name, owner in this respective order within the specified workspace. If only workspace ID is provided, this will return all the datasets in a workspace.
- Parameters
datasetId (str) – Dataset ID to filter.
name (str) – Dataset name.
email (str) – Owner of the dataset.
workspaceId (str) – Workspace ID of the dataset’s workspace. If none is provided, the current workspace will get used.
- Returns
Information about the dataset based off the query parameters provided or a failure message.
- Return type
str
- get_default_graph(channelId)¶
Gets the default graph for a channel.
- Parameters
channelId – Id of channel to get the default graph for.
- Returns
json data representing the graph.
- Return type
json
- get_deployment_status(deploymentId, stream=False)¶
Retrieves status for a channel’s deployment.
- Parameters
deploymentId (str) – The deploymentId to retrieve status for
stream (bool) – Flag to print information to the terminal so the user can avoid constant polling to retrieve status.
- Returns
Deployment status.
- Return type
list[dict]
- get_gan_datasets(datasetId=None, gandatasetId=None, workspaceId=None)¶
Retrieve information about GAN dataset jobs.
- Parameters
datasetId (str) – Dataset ID to retrieve information for.
gandatasetId (str) – Gan dataset ID to retrieve.
workspaceId (str) – Workspace ID where the dataset exists.
- Returns
Information about the GAN Dataset.
- Return type
list[dict]
- get_gan_models(organizationId=None, workspaceId=None, modelId=None)¶
Retrieve information about GAN models
- Parameters
organizationId (str) – Organization ID that owns the models
workspaceId (str) – Workspace ID that contains the models
modelId (str) – Model ID to retrieve information for.
- Returns
GAN Model information.
- Return type
list[dict]
- get_inpaint_logs(volumeId, inpaintId)¶
Fetches the logs for the inpaint job.
- Parameters
volumeId (str) – Volume ID
inpaintId (str) – Inpaint ID
- Returns
logs
- Return type
str
- get_inpaints(volumeId, inpaintId=None)¶
Fetches the inpaint jobs in the volume.
- Parameters
volumeId (str) – Volume ID
inpaintId (str) – Inpaint ID
- Returns
Inpaint jobs info
- Return type
dict
- get_llm_base_channels()¶
Gets a list of the base channels
- Returns
A list of the base channels
- Return type
list[str]
- get_llm_channel_node_types()¶
Gets a dictionary of base channels. For each channel there is a list of valid node types.
- Returns
A dictionary of base channels and their valid node types
- Return type
dict
- get_llm_response(promptId)¶
Retrieves the response to an LLM prompt.
- Parameters
promptId (str) – The ID of a prompt.
- Returns
Prompt response info
- Return type
dict
- get_managed_channels(channelId=None, organizationId=None)¶
Get information for all managed channels that you own within your organization.
- Parameters
channelId (str) – Channel Id to filter.
organizationId (str) – Organization ID. Defaults to current if not specified.
- Returns
channel data
- Return type
list[dict]
- get_managed_gans(organizationId=None, modelId=None)¶
Retrieves the managed GANs for an organization.
- Parameters
organizationId (str) – The ID of the organization that the managed GAN belongs to.
modelId (str) – The ID of a specific model.
- Returns
Model Info
- Return type
list[dict]
- get_managed_maps(organizationId=None, mapId=None)¶
Retrieves the map(s) managed by the organization
- Parameters
organizationId (str) – Organization ID to retrieve maps for. If not specified then the current organization is used.
mapId (str) – Annotation map ID to retrieve
- Returns
The requested annotation maps.
- Return type
str
- get_managed_volumes(volumeId=None, organizationId=None)¶
Retrieves the managed volumes for an organization.
- Parameters
volumeId (str) – The ID of a specific Volume.
organizationId (str) – The ID of the organization that the managed volume belongs to.
- Returns
Volume Info
- Return type
list[dict]
- get_ml_architectures()¶
Retrieves the machine learning model architectures available on the platform.
- Parameters
None –
- Returns
Machine learning model architectures
- Return type
dict
- get_ml_inference_metrics(inferenceId, workspaceId=None)¶
Get the metrics from an inference job.
- Parameters
inferenceId (str) – Inference ID
workspaceId (str) – Workspace ID
- Returns
Metric data
- Return type
dict
- get_ml_inferences(inferenceId=None, datasetId=None, modelId=None, workspaceId=None)¶
Get the inferences of a machine learning model.
- Parameters
inferenceId (str) – Inference ID
datasetId (str) – Dataset ID
modelId (str) – Model ID
workspaceId (str) – Workspace ID
- Returns
Inference data
- Return type
dict
- get_ml_models(workspaceId=None, datasetId=None, modelId=None)¶
Retrieves the machine learning model architectures available on the platform.
- Parameters
workspaceId (str) – Workspace ID
datasetId (str) – Dataset ID
modelId (str) – Model ID
- Returns
Machine learning model architectures
- Return type
dict
- get_organization()¶
Get organization id of current organization.
- Returns
Organization ID of current workspace.
- Return type
str
- get_organization_invites(organizationId=None)¶
Get invitations of an organization.
- Parameters
organizationId (str) – Organization ID. Defaults to current if not specified.
- Returns
Information about invitations of an organization.
- Return type
list[dict]
- get_organization_members(organizationId=None)¶
Get users of an organization.
- Parameters
organizationId (str) – Organization ID. Defaults to current if not specified.
- Returns
Information about users of an organization.
- Return type
list[dict]
- get_organizations(organizationId=None)¶
Shows the organizations the user belongs to and the user’s role in that organization.
- Returns
Information about the organizations you belong to.
- Return type
list[dict]
- get_staged_graphs(graphId=None, name=None, email=None, workspaceId=None)¶
Queries the workspace staged graphs based off provided parameters. Checks on graphId, name, or owner in this respective order within the specified workspace. If only workspace ID is provided, this will return all the staged graphs in a workspace.
- Parameters
graphid (str) – Staged GraphID to filter on. Optional.
name (str) – Name of the staged graph to filter on. Optional.
email (str) – Owner of staged graphs to filter on. Optional.
workspaceId (str) – Workspace ID to filter on. If none is provided, the default workspace will get used.
- Returns
A list of staged graphs based off provided query parameters if any parameters match.
- Return type
list[dict]
- get_system_status(serviceId=None, display=True)¶
Fetches the system status, if no serviceId is provided it will fetch all services.
- Parameters
serviceId (str) – The identifier of the service to fetch the status of.
display (bool) – Boolean for either displaying the status or returning as a dict.
- get_umaps(umapId=None, datasetId=None, workspaceId=None)¶
Retrieves information about UMAP dataset comparison from the platform.
- Parameters
umapId (str) – UMAP Job ID.
datasetId (str) – Dataset Id to filter on.
workspaceId (str) – Workspace ID where the datasets exists.
- Returns
UMAP information.
- Return type
dict
- get_volume_data(volumeId, files=[], dir='')¶
Retrieves information about data from a volume.
- Parameters
volumeId (str) – VolumeId to remove access to.
files (str) – The specific files or directories to retrieve information about from the volume, if you wish to retrieve all then leave the list empty.
dir (str) – Specific volume directory to retrieve information about. Optional.
- Returns
Status
- Return type
str
- get_volumes(volumeId=None, workspaceId=None, organizationId=None)¶
Retrieves all volumes the user has access to.
- Parameters
volumeId (str) – The ID of a specific Volume.
organizationId (str) – The ID of the organization that the volume belongs to.
- Returns
Volume Info
- Return type
list[dict]
- get_workspace()¶
Get Workspace ID of current workspace.
- Returns
Workspace ID of current workspace.
- Return type
str
- get_workspaces(organizationId=None, workspaceId=None)¶
Shows list of workspaces with id, name, and owner data.
- Parameters
organizationId (str) – Organization ID to filter on. Optional
workspaceId (str) – Workspace ID to filter on. Optional
- Returns
Workspace data for all workspaces for a user.
- Return type
list[dict]
- list_remote_development(organizationId=None)¶
Shows all the active development sessions in the organization.
- Parameters
organizationId (str) – The ID of the organization to list the active development sessions. If not provided, defaults to the user’s organization
- Returns
List of remote development environments running in the organization.
- Return type
list[dict]
- login(workspaceId=None, environment='prod', email=None, password=None, local=False, interactive=True, verbose=None)¶
Log in to the SDK.
- Parameters
workspaceId (str) – ID of the workspace to log in to. Uses default if not specified.
environment (str) – Environment to log into. Defaults to production.
email (str) – Email for the login. Will prompt if not provided.
password (str) – Password to login. Will prompt if not provided.
local (bool) – Used for development to indicate pointing to local API.
interactive (bool) – Set to False for muting the login messages.
verbose (str) – Flag to turn on verbose logging. Use ‘debug’ to view log output.
- logout()¶
Logs out of the ana sdk and removes credentials from ana.
- mount_volumes(volumes)¶
Retrieves credentials for mounting volumes.
- Parameters
volumes ([str]) – Volumes to retrieve mount credentials for.
- Returns
Credential information.
- Return type
dict
- refresh_token()¶
- remove_organization_invitation(email, organizationId=None, invitationId=None)¶
Remove a invitation from an existing organization.
- Parameters
email (str) – Invitation email to remove.
organizationId (str) – Organization ID to remove member from. Removes from current organization if not specified.
invitationId (str) – Invitation ID to remove invitation from. Removes from current organization if not specified.
- Returns
Response status if member got removed from organization succesfully.
- Return type
str
- remove_organization_member(email, organizationId=None)¶
Remove a member from an existing organization.
- Parameters
email (str) – Member email to remove.
organizationId (str) – Organization ID to remove member from. Removes from current organization if not specified.
- Returns
Response status if member got removed from organization succesfully.
- Return type
str
- remove_workspace_invitation(email, workspaceId=None, invitationId=None)¶
Remove a invitation from an existing organization.
- Parameters
email (str) – Invitation email to remove.
workspaceId (str) – Workspace ID to remove member from. Removes from current organization if not specified.
inviteId (str) – Invitation ID to remove invitation from. Removes from current organization if not specified.
- Returns
Response status if member got removed from organization succesfully.
- Return type
str
- set_default_graph(channelId, workspaceId, graphId=None, stagedGraphId=None)¶
Sets the default graph for a channel. User must be in the organization that manages the channel.
- Parameters
channel (str) – The name of the channel to update the default graph.
workspaceId (str) – The ID of the Workspace that the graph is in.
graphId (str) – The ID of the graph that you want to be the default for the channel. Optional.
stagedGraphId (str) – The ID of the staged graph that you want to be the default for the channel. Optional.
- Returns
Status
- Return type
str
- set_organization(organizationId, workspaceId=None)¶
Set the organization (and optionally a workspace) to the one you wish to work in.
- Parameters
organizationId (str) – Organization ID for the organization you wish to work in.
workspaceId (str) – Workspace ID for the workspace you wish to work in. Uses default workspace if this is not set.
- set_workspace(workspaceId)¶
Set the workspace to the one you wish to work in.
- Parameters
workspaceId (str) – Workspace ID for the workspace you wish to work in.
- sign_in_apikey(interactive)¶
- upload_channel_documentation(channelId, mdfile)¶
Uploads a markdown file for channel documentation.
- Parameters
channelID (str) – The channelId of the channel
mdfile (str) – The filepath of the markdown file used for channel documentation.
- Returns
Success/Failure of channel documenation upload.
- Return type
bool
- upload_dataset(filename, description=None, workspaceId=None)¶
Uploads user dataset using multipart upload with 8 threads.
- Parameters
filename (str) – Path to the dataset folder or file for uploading. Must be zip or tar file types.
workspaceId (str) – WorkspaceId to upload dataset to. Defaults to current.
description (str) – Description for new dataset.
- Returns
datasetId – The unique identifier for this dataset.
- Return type
str
- upload_ml_model(name, description, modelfile, parameters, workspaceId=None)¶
Upload a machine learning model.
- Parameters
name (str) – Model name
description (str) – Model description
modelfile (str) – The filepath of the model file
parameters (str) – Model training parameters
workspaceId (str) – Workspace ID
- Returns
Success / failure
- Return type
bool
- upload_volume_data(volumeId, files=[], localDir=None, sync=False)¶
Upload data to a volume.
- Parameters
volumeId (str) – VolumeId to upload data to.
files (list[str]) – The specific files or directories to push to the volume from the localDir. If you wish to push all data in the root directory, then leave the list empty.
localDir (str) – The location of the local directory to upload the files from. If not specified, this will try to upload the files from the current directory.
sync (bool) – Recursively uploads new and updated files from the source to the destination. Only creates folders in the destination if they contain one or more files.
- Returns
Status
- Return type
str