diff --git a/.gitignore b/.gitignore index 3e29bf8..4145e91 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,5 @@ htmlcov/ nosetests.xml coverage.xml *.cover + +.idea diff --git a/scaleapi/__init__.py b/scaleapi/__init__.py index 7e4368e..ff4b5b5 100644 --- a/scaleapi/__init__.py +++ b/scaleapi/__init__.py @@ -1,4 +1,4 @@ -from typing import IO, Dict, Generator, Generic, List, TypeVar, Union +from typing import IO, Dict, Generator, Generic, List, Optional, TypeVar, Union from scaleapi.batches import Batch, BatchStatus from scaleapi.evaluation_tasks import EvaluationTask @@ -782,6 +782,7 @@ def create_project( params: Dict = None, rapid: bool = False, studio: bool = False, + dataset_id: Optional[str] = None, ) -> Project: """Creates a new project. https://docs.scale.com/reference#project-creation @@ -789,13 +790,21 @@ def create_project( Args: project_name (str): Project name - task_type (TaskType): Task Type i.e. `TaskType.ImageAnnotation` - params (Dict): - Project parameters to be specificed. + Project parameters to be specified. i.e. `{'instruction':'Please label the kittens'}` + rapid (bool): + Whether the project being created is a + Scale Rapid project + studio (bool): + Whether the project being created is a + Scale Studio project + dataset_id (str): + Link this project to an existing Nucleus dataset. + All tasks annotated in this project will + be synced to the given dataset. Returns: Project: [description] @@ -807,6 +816,7 @@ def create_project( params=params, rapid=rapid, studio=studio, + datasetId=dataset_id, ) projectdata = self.api.post_request(endpoint, body=payload) return Project(projectdata, self)