Recipe SDK
  • Print
  • Share
  • Dark
    Light

Recipe SDK

  • Print
  • Share
  • Dark
    Light

To reach the recipes repository press here

To reach the recipes entity press here

To learn more about Dataloop's recipe go to What are Recipe & Ontology?

For a UI usage of recipe go to Ontology or Instructions pages.


Highlighted text require your input

Relations

Prep

import dtlpy as dl
if dl.token_expired():
    dl.login()
project = dl.projects.get(project_name='project_name')
dataset = project.datasets.get(dataset_name='dataset_name')

Recipe

Get Recipe

from List

recipe = dataset.recipes.list()[0]

by ID

recipe = dataset.recipes.get(recipe_id='your-recipe-id') 

Delete Recipe

This command is only for DELETED datasets

dataset.recipes.get(recipe_id='your-recipe-id').delete()) 

Recipe Clone

shallow: If True, link to existing ontology, 

              If false clone all ontologies that are links to the recipe as well.

import dtlpy as dl
if dl.token_expired():
     dl.login()
project = dl.projects.get(project_name='myProject')
dataset = project.datasets.get(dataset_name="myDataSet")
recipe = dataset.recipes.get(recipe_id="recipe_id")
recipe2 = recipe.clone(shallow=False) #dataset or dataset id, if the function is given dataset or dataset id parameters, the recipe will be linked to the given dataset

Recipe Switch

Notice that if you delete a recipe it will delete it for all its linked datasets

dataset.switch_recipe(recipe=recipe2 #or use recipe Id
                                         )
Was This Article Helpful?