# Blueprints
URL: https://docs.datarobot.com/en/docs/api/reference/sdk/blueprints.html

# Blueprints

## Blueprint

### class datarobot.models.Blueprint

A Blueprint which can be used to fit models

- Variables:

#### classmethod get(project_id, blueprint_id)

Retrieve a blueprint.

- Parameters:
- Returns: blueprint – The queried blueprint.
- Return type: Blueprint

#### get_json()

Get the blueprint json representation used by this model.

- Returns: Json representation of the blueprint stages.
- Return type: BlueprintJson

#### get_chart()

Retrieve a chart.

- Returns: The current blueprint chart.
- Return type: BlueprintChart

#### get_documents()

Get documentation for tasks used in the blueprint.

- Returns: All documents available for blueprint.
- Return type: list of BlueprintTaskDocument

#### classmethod from_data(data)

Instantiate an object of this class using a dict.

- Parameters: data ( dict ) – Correctly snake_cased keys and their values.
- Return type: TypeVar ( T , bound= APIObject)

#### classmethod from_server_data(data, keep_attrs=None)

Instantiate an object of this class using the data directly from the server,
meaning that the keys may have the wrong camel casing

- Parameters:
- Return type: TypeVar ( T , bound= APIObject)

### class datarobot.models.BlueprintTaskDocument

Document describing a task from a blueprint.

- Variables:

### class datarobot.models.BlueprintChart

A Blueprint chart that can be used to understand data flow in blueprint.

- Variables:

#### classmethod get(project_id, blueprint_id)

Retrieve a blueprint chart.

- Parameters:
- Returns: The queried blueprint chart.
- Return type: BlueprintChart

#### to_graphviz()

Get blueprint chart in graphviz DOT format.

- Returns: String representation of chart in graphviz DOT language.
- Return type: unicode

### class datarobot.models.ModelBlueprintChart

A Blueprint chart that can be used to understand data flow in model.
Model blueprint chart represents reduced repository blueprint chart with
only elements that used to build this particular model.

- Variables:

#### classmethod get(project_id, model_id)

Retrieve a model blueprint chart.

- Parameters:
- Returns: The queried model blueprint chart.
- Return type: ModelBlueprintChart

#### to_graphviz()

Get blueprint chart in graphviz DOT format.

- Returns: String representation of chart in graphviz DOT language.
- Return type: unicode

## User blueprints

### class datarobot.UserBlueprint

A representation of a blueprint which may be modified by the user,
saved to a user’s AI Catalog, trained on projects, and shared with others.

It is recommended to install the python library called `datarobot_bp_workshop`,
available via `pip`, for the best experience when building blueprints.

Please refer to `http://blueprint-workshop.datarobot.com` for tutorials,
examples, and other documentation.

- Parameters:

#### classmethod list(limit=100, offset=0, project_id=None)

Fetch a list of the user blueprints the current user created

- Parameters:
- Raises:
- Return type: list[UserBlueprint]

#### classmethod get(user_blueprint_id, project_id=None)

Retrieve a user blueprint

- Parameters:
- Raises:
- Return type: UserBlueprint

#### classmethod create(blueprint, model_type=None, project_id=None, save_to_catalog=True)

Create a user blueprint

- Parameters:
- Raises:
- Return type: UserBlueprint

#### classmethod create_from_custom_task_version_id(custom_task_version_id, save_to_catalog=True, description=None)

Create a user blueprint with a single custom task version

- Parameters:
- Raises:
- Return type: UserBlueprint

#### classmethod clone_project_blueprint(blueprint_id, project_id, model_type=None, save_to_catalog=True)

Clone a blueprint from a project.

- Parameters:
- Raises:
- Return type: UserBlueprint

#### classmethod clone_user_blueprint(user_blueprint_id, model_type=None, project_id=None, save_to_catalog=True)

Clone a user blueprint.

- Parameters:
- Raises:
- Return type: UserBlueprint

#### classmethod update(blueprint, user_blueprint_id, model_type=None, project_id=None, include_project_id_if_none=False)

Update a user blueprint

- Parameters:
- Raises:
- Return type: UserBlueprint

#### classmethod delete(user_blueprint_id)

Delete a user blueprint, specified by the userBlueprintId.

- Parameters: user_blueprint_id ( string ) – Used to identify a specific user-owned blueprint.
- Raises:
- Return type: requests.models.Response

#### classmethod get_input_types()

Retrieve the input types which can be used with User Blueprints.

- Raises:
- Return type: UserBlueprintAvailableInput

#### classmethod add_to_project(project_id, user_blueprint_ids)

Add a list of user blueprints, by id, to a specified (by id) project’s repository.

- Parameters:
- Raises:
- Return type: UserBlueprintAddToProjectMenu

#### classmethod get_available_tasks(project_id=None, user_blueprint_id=None)

Retrieve the available tasks, organized into categories, which can be used to create or
modify User Blueprints.

- Parameters:
- Raises:
- Return type: UserBlueprintAvailableTasks

#### classmethod validate_task_parameters(output_method, task_code, task_parameters, project_id=None)

Validate that each value assigned to specified task parameters are valid.

- Parameters:
- Raises:
- Return type: UserBlueprintValidateTaskParameters

#### classmethod list_shared_roles(user_blueprint_id, limit=100, offset=0, id=None, name=None, share_recipient_type=None)

Get a list of users, groups and organizations that have an access to this user blueprint

- Parameters:
- Raises:
- Return type: list[UserBlueprintSharedRolesResponseValidator]

#### classmethod validate_blueprint(blueprint, project_id=None)

Validate a user blueprint and return information about the inputs expected and outputs
provided by each task.

- Parameters:
- Raises:
- Return type: list[VertexContextItem]

#### classmethod update_shared_roles(user_blueprint_id, roles)

Share a user blueprint with a user, group, or organization

- Parameters:
- Raises:
- Return type: requests.models.Response

#### classmethod search_catalog(search=None, tag=None, limit=100, offset=0, owner_user_id=None, owner_username=None, order_by='-created')

Fetch a list of the user blueprint catalog entries the current user has access to
based on an optional search term, tags, owner user info, or sort order.

- Parameters:
- Return type: UserBlueprintCatalogSearch

### class datarobot.models.user_blueprints.models.UserBlueprintAvailableInput

Retrieve the input types which can be used with User Blueprints.

- Parameters: input_types ( list(UserBlueprintsInputType) ) – A list of associated pairs of an input types and their human-readable names.

#### classmethod get_input_types()

Retrieve the input types which can be used with User Blueprints.

- Raises:
- Return type: UserBlueprintAvailableInput

### class datarobot.models.user_blueprints.models.UserBlueprintAddToProjectMenu

Add a list of user blueprints, by id, to a specified (by id) project’s repository.

- Parameters:

#### classmethod add_to_project(project_id, user_blueprint_ids)

Add a list of user blueprints, by id, to a specified (by id) project’s repository.

- Parameters:
- Raises:
- Return type: UserBlueprintAddToProjectMenu

### class datarobot.models.user_blueprints.models.UserBlueprintAvailableTasks

Retrieve the available tasks, organized into categories, which can be used to create or modify
User Blueprints.

- Parameters:

#### classmethod get_available_tasks(project_id=None, user_blueprint_id=None)

Retrieve the available tasks, organized into categories, which can be used to create or
modify User Blueprints.

- Parameters:
- Raises:
- Return type: UserBlueprintAvailableTasks

### class datarobot.models.user_blueprints.models.UserBlueprintValidateTaskParameters

Validate that each value assigned to specified task parameters are valid.

- Parameters: errors ( list(UserBlueprintsValidateTaskParameter) ) – A list of the task parameters, their proposed values, and messages describing why each is
  not valid.

#### classmethod validate_task_parameters(output_method, task_code, task_parameters, project_id=None)

Validate that each value assigned to specified task parameters are valid.

- Parameters:
- Raises:
- Return type: UserBlueprintValidateTaskParameters

### class datarobot.models.user_blueprints.models.UserBlueprintSharedRolesResponseValidator

A list of SharedRoles objects.

- Parameters:

### class datarobot.models.user_blueprints.models.VertexContextItem

Info about, warnings about, and errors with a specific vertex in the blueprint.

- Parameters:

### class datarobot.models.user_blueprints.models.UserBlueprintCatalogSearch

An APIObject representing a user blueprint catalog entry the current
user has access to based on an optional search term and/or tags.

- Parameters:

#### classmethod search_catalog(search=None, tag=None, limit=100, offset=0, owner_user_id=None, owner_username=None, order_by='-created')

Fetch a list of the user blueprint catalog entries the current user has access to
based on an optional search term, tags, owner user info, or sort order.

- Parameters:
- Return type: List [ UserBlueprintCatalogSearch ]

## Custom tasks

### class datarobot.CustomTask

A custom task. This can be in a partial state or a complete state.
When the latest_version is None, the empty task has been initialized with
some metadata.  It is not yet use-able for actual training.  Once the first
CustomTaskVersion has been created, you can put the CustomTask in UserBlueprints to
train Models in Projects

Added in version v2.26.

- Variables:

#### classmethod from_server_data(data, keep_attrs=None)

Instantiate an object of this class using the data directly from the server,
meaning that the keys may have the wrong camel casing

- Parameters:
- Return type: CustomTask

#### classmethod list(order_by=None, search_for=None)

List custom tasks available to the user.

Added in version v2.26.

- Parameters:
- Returns: a list of custom tasks.
- Return type: List[CustomTask]
- Raises:

#### classmethod get(custom_task_id)

Get custom task by id.

Added in version v2.26.

- Parameters: custom_task_id ( str ) – id of the custom task
- Returns: retrieved custom task
- Return type: CustomTask
- Raises:

#### classmethod copy(custom_task_id)

Create a custom task by copying existing one.

Added in version v2.26.

- Parameters: custom_task_id ( str ) – id of the custom task to copy
- Return type: CustomTask
- Raises:

#### classmethod create(name, target_type, language=None, description=None, calibrate_predictions=None, **kwargs)

Creates only the metadata for a custom task.  This task will
not be use-able until you have created a CustomTaskVersion attached to this task.

Added in version v2.26.

- Parameters:

#### update(name=None, language=None, description=None, **kwargs)

Update custom task properties.

Added in version v2.26.

- Parameters:
- Raises:
- Return type: None

#### refresh()

Update custom task with the latest data from server.

Added in version v2.26.

- Raises:
- Return type: None

#### delete()

Delete custom task.

Added in version v2.26.

- Raises:
- Return type: None

#### download_latest_version(file_path)

Download the latest custom task version.

Added in version v2.26.

- Parameters: file_path ( str ) – the full path of the target zip file
- Raises:
- Return type: None

#### get_access_list()

Retrieve access control settings of this custom task.

Added in version v2.27.

- Return type: list of SharingAccess

#### share(access_list)

Update the access control settings of this custom task.

Added in version v2.27.

- Parameters: access_list ( list of SharingAccess ) – A list of SharingAccess to update.
- Raises:
- Return type: None

> [!NOTE] Examples
> Transfer access to the custom task from [old_user@datarobot.com](mailto:old_user@datarobot.com) to [new_user@datarobot.com](mailto:new_user@datarobot.com)
> 
> ```
> import datarobot as dr
> 
> new_access = dr.SharingAccess(new_user@datarobot.com,
>                               dr.enums.SHARING_ROLE.OWNER, can_share=True)
> access_list = [dr.SharingAccess(old_user@datarobot.com, None), new_access]
> 
> dr.CustomTask.get('custom-task-id').share(access_list)
> ```

### class datarobot.models.custom_task_version.CustomTaskFileItem

A file item attached to a DataRobot custom task version.

Added in version v2.26.

- Variables:

### class datarobot.enums.CustomTaskOutboundNetworkPolicy

The way to set and view a CustomTaskVersions outbound network policy.

### class datarobot.CustomTaskVersion

A version of a DataRobot custom task.

Added in version v2.26.

- Variables:

#### classmethod from_server_data(data, keep_attrs=None)

Instantiate an object of this class using the data directly from the server,
meaning that the keys may have the wrong camel casing

- Parameters:

#### classmethod create_clean(custom_task_id, base_environment_id, maximum_memory=None, is_major_update=True, folder_path=None, required_metadata_values=None, outbound_network_policy=None)

Create a custom task version without files from previous versions.

Added in version v2.26.

- Parameters:
- Returns: created custom task version
- Return type: CustomTaskVersion
- Raises:

#### classmethod create_from_previous(custom_task_id, base_environment_id, maximum_memory=None, is_major_update=True, folder_path=None, files_to_delete=None, required_metadata_values=None, outbound_network_policy=None)

Create a custom task version containing files from a previous version.

Added in version v2.26.

- Parameters:
- Returns: created custom task version
- Return type: CustomTaskVersion
- Raises:

#### classmethod list(custom_task_id)

List custom task versions.

Added in version v2.26.

- Parameters: custom_task_id ( str ) – the ID of the custom task
- Returns: a list of custom task versions
- Return type: List[CustomTaskVersion]
- Raises:

#### classmethod get(custom_task_id, custom_task_version_id)

Get custom task version by id.

Added in version v2.26.

- Parameters:
- Returns: retrieved custom task version
- Return type: CustomTaskVersion
- Raises:

#### download(file_path)

Download custom task version.

Added in version v2.26.

- Parameters: file_path ( str ) – path to create a file with custom task version content
- Raises:

#### update(description=None, required_metadata_values=None)

Update custom task version properties.

Added in version v2.26.

- Parameters:
- Raises:

#### refresh()

Update custom task version with the latest data from server.

Added in version v2.26.

- Raises:

#### start_dependency_build()

Start the dependency build for a custom task version and return build status.
.. versionadded:: v2.27

- Returns: DTO of custom task version dependency build.
- Return type: CustomTaskVersionDependencyBuild

#### start_dependency_build_and_wait(max_wait)

Start the dependency build for a custom task version and wait while pulling status.
.. versionadded:: v2.27

- Parameters: max_wait ( int ) – max time to wait for a build completion
- Returns: DTO of custom task version dependency build.
- Return type: CustomTaskVersionDependencyBuild
- Raises:

#### cancel_dependency_build()

Cancel custom task version dependency build that is in progress.
.. versionadded:: v2.27

- Raises:

#### get_dependency_build()

Retrieve information about a custom task version’s dependency build.
.. versionadded:: v2.27

- Returns: DTO of custom task version dependency build.
- Return type: CustomTaskVersionDependencyBuild

#### download_dependency_build_log(file_directory='.')

Get log of a custom task version dependency build.
.. versionadded:: v2.27

- Parameters: file_directory ( str (optional , default is "."``) ) – Directory path where downloaded file is to save.
- Raises:

## Visual AI

### class datarobot.models.visualai.images.Image

An image stored in a project’s dataset.

- Variables:

#### classmethod get(project_id, image_id)

Get a single image object from project.

- Parameters:
- Return type: Image

### class datarobot.models.visualai.images.SampleImage

A sample image in a project’s dataset.

If `Project.stage` is `datarobot.enums.PROJECT_STAGE.EDA2` then
the `target_*` attributes of this class will have values, otherwise
the values will all be None.

- Variables:

#### classmethod list(project_id, feature_name, target_value=None, target_bin_start=None, target_bin_end=None, offset=None, limit=None)

Get sample images from a project.

- Parameters:
- Return type: List [ SampleImage ]

### class datarobot.models.visualai.images.DuplicateImage

An image that was duplicated in the project dataset.

- Variables:

#### classmethod list(project_id, feature_name, offset=None, limit=None)

Get all duplicate images in a project.

- Parameters:
- Return type: List [ DuplicateImage ]

### class datarobot.models.visualai.insights.ImageEmbedding

Vector representation of an image in an embedding space.

A vector in an embedding space will allow linear computations to
be carried out between images: for example computing the Euclidean
distance of the images.

- Variables:

#### classmethod compute(project_id, model_id)

Start the computation of image embeddings for the model.

- Parameters:
- Returns: URL to check for image embeddings progress.
- Return type: str
- Raises: datarobot.errors.ClientError – Server rejected creation due to client error. Most likely
      cause is bad project_id or model_id .

#### classmethod models(project_id)

For a given project_id, list all model_id - feature_name pairs with available
Image Embeddings.

- Parameters: project_id ( str ) – Id of the project to list model_id - feature_name pairs with available Image Embeddings
  for.
- Returns: List of model and feature name pairs.
- Return type: list( tuple(model_id , feature_name) )

#### classmethod list(project_id, model_id, feature_name)

Return a list of ImageEmbedding objects.

- Parameters:
- Return type: List [ ImageEmbedding ]

### class datarobot.models.visualai.insights.ImageActivationMap

Mark areas of image with weight of impact on training.

This is a technique to display how various areas of the region were
used in training, and their effect on predictions. Larger values in `activation_values` indicates a larger impact.

- Variables:

#### classmethod compute(project_id, model_id)

Start the computation of activation maps for the given model.

- Parameters:
- Returns: URL to check for image embeddings progress.
- Return type: str
- Raises: datarobot.errors.ClientError – Server rejected creation due to client error. Most likely
      cause is bad project_id or model_id .

#### classmethod models(project_id)

For a given project_id, list all model_id - feature_name pairs with available
Image Activation Maps.

- Parameters: project_id ( str ) – Id of the project to list model_id - feature_name pairs with available
  Image Activation Maps for.
- Returns: List of model and feature name pairs.
- Return type: list( tuple(model_id , feature_name) )

#### classmethod list(project_id, model_id, feature_name, offset=None, limit=None)

Return a list of ImageActivationMap objects.

- Parameters:
- Return type: List [ ImageActivationMap ]

### class datarobot.models.visualai.augmentation.ImageAugmentationOptions

A List of all supported Image Augmentation Transformations for a project.
Includes additional information about minimum, maximum, and default values
for a transformation.

- Variables:

#### classmethod get(project_id)

Returns a list of all supported transformations for the given
project

- Parameters: project_id ( str ) – sting
  The id of the project for which to return the list of supported transformations.
- Return type: ImageAugmentationOptions
- Returns: ImageAugmentationOptions
  : A list containing all the supported transformations for the project.

### class datarobot.models.visualai.augmentation.ImageAugmentationList

A List of Image Augmentation Transformations

- Variables:

#### classmethod create(name, project_id, feature_name=None, initial_list=False, transformation_probability=0.0, number_of_new_images=1, transformations=None, samples_id=None)

create a new image augmentation list

- Return type: ImageAugmentationList

#### classmethod list(project_id, feature_name=None)

List Image Augmentation Lists present in a project.

- Parameters:
- Return type: list[ImageAugmentationList]

#### update(name=None, feature_name=None, initial_list=None, transformation_probability=None, number_of_new_images=None, transformations=None)

Update one or multiple attributes of the Image Augmentation List in the DataRobot backend
as well on this object.

- Parameters:
- Returns: Reference to self. The passed values will be updated in place.
- Return type: ImageAugmentationList

#### retrieve_samples()

Lists already computed image augmentation sample for image augmentation list.
Returns samples only if they have been already computed. It does not initialize computation.

- Return type: List of class ImageAugmentationSample

#### compute_samples(max_wait=600)

Initializes computation and retrieves list of image augmentation samples
for image augmentation list. If samples exited prior to this call method,
this will compute fresh samples and return latest version of samples.

- Return type: List of class ImageAugmentationSample

### class datarobot.models.visualai.augmentation.ImageAugmentationSample

A preview of the type of images that augmentations will create during training.

- Variables:

#### classmethod list(auglist_id=None)

Return a list of ImageAugmentationSample objects.

- Parameters: auglist_id ( str ) – ID for augmentation list to retrieve samples for
- Return type: List of class ImageAugmentationSample

---
