Once you have your data, your Ontology, and a Workflow template, it is time to create a Project. Labels are created and reviewed within Projects. Projects tie together Datasets, Ontologies, and labels.
Substitute the following values into the script below:
- <private_key_path> with the path to your private key.
- <project_title> with the title you want to give the Project.
- <dataset_hash> with the hash of the Dataset(s) you want to attach to the Project. See here for more information.
- <ontology_hash> with the hash of the Ontology you created for this Project (output in Step 1). See here for more information.
- <template_hash> with the hash of the Workflow template. See here for more information.
Tip
To use an existing template when creating a Project, users must have Admin privileges on the template. We recommend creating a copy of the Workflow template before Project creation, to ensure you have Admin privileges.
# Import dependencies
from encord.user_client import EncordUserClient
# Authenticate using the path to your private key. Replace <private_key_path> with the path to your key
user_client = EncordUserClient.create_with_ssh_private_key(
ssh_private_key_path="<private_key_path>"
)
# Create a project. Substitute the project title, dataset hashes, and template hash.
project = user_client.create_project(
project_title="<project_title>",
dataset_hashes=["<dataset_hash_1>", "<dataset_hash_2>"],
ontology_hash= "<ontology_hash>"
workflow_template_hash="<template_hash>"
)
# Prints the Project hash
print (project.project_hash)
a8b8d026-1c99-4cfc-910d-7f66be957f3d