> ## Documentation Index
> Fetch the complete documentation index at: https://docs.encord.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Project

## Project Objects

```python theme={"dark"}
class Project()
```

Access project related data and manipulate the project.

#### project\_hash

```python theme={"dark"}
@property
def project_hash() -> str
```

Get the project hash (i.e. the Project ID).

#### status

```python theme={"dark"}
@property
def status() -> ProjectStatus
```

Get the status of the project.

#### title

```python theme={"dark"}
@property
def title() -> str
```

Get the title of the project.

#### description

```python theme={"dark"}
@property
def description() -> str
```

Get the description of the project.

#### created\_at

```python theme={"dark"}
@property
def created_at() -> datetime.datetime
```

Get the time the project was created at.

#### last\_edited\_at

```python theme={"dark"}
@property
def last_edited_at() -> datetime.datetime
```

Get the time the project was last edited at.

#### ontology

```python theme={"dark"}
@property
@deprecated(version="0.1.95", alternative=".ontology_structure")
def ontology() -> Dict[str, Any]
```

Get the ontology of the project.

DEPRECATED: Prefer using the [ontology\_structure()](/sdk-documentation/sdk-references/project#ontology_structure) method.
This method returns the same structure as [ontology\_structure()](/sdk-documentation/sdk-references/project#ontology_structure), just in
raw python dictionary format.

#### ontology\_hash

```python theme={"dark"}
@property
def ontology_hash() -> str
```

Get the ontology hash of the project's ontology.

#### ontology\_structure

```python theme={"dark"}
@property
def ontology_structure() -> OntologyStructure
```

Get the ontology structure of the project's ontology.

#### user\_role

```python theme={"dark"}
@property
def user_role() -> Optional[ProjectUserRole]
```

Get the current user's role in the project.

This may return `None` if the user is an organizational admin and has accessed the project e.g. using
`include_org_access=True` of [list\_projects()](/sdk-documentation/sdk-references/user_client#list_projects).

#### source\_projects

```python theme={"dark"}
@property
def source_projects() -> Optional[List[str]]
```

Get the source projects for a Training project. Returns None for non-Training projects.

#### datasets

```python theme={"dark"}
@property
@deprecated(version="0.1.117", alternative=".list_datasets")
def datasets() -> List[Dict[str, Any]]
```

DEPRECATED: Prefer using the [list\_datasets()](/sdk-documentation/sdk-references/project#list_datasets) method to work with the data.

Get the info about datasets associated with this project.

#### project\_type

```python theme={"dark"}
@property
def project_type() -> ProjectType
```

Get the project type.

#### label\_rows

```python theme={"dark"}
@property
@deprecated(version="0.1.104", alternative=".list_label_rows_v2")
def label_rows() -> Dict
```

Get the label rows.
DEPRECATED: Prefer using [list\_label\_rows\_v2()](/sdk-documentation/sdk-references/project#list_label_rows_v2) method and [LabelRowV2()](/sdk-documentation/sdk-references/objects.ontology_labels_impl#labelrowv2) class to work with the data.

.. code::

from encord.orm.label\_row import LabelRowMetadata

project = user\_client.get\_project("\[project\_hash]")

label\_rows = LabelRowMetadata.from\_list(project.label\_rows)

#### refetch\_data

```python theme={"dark"}
def refetch_data() -> None
```

The Project class will only fetch its properties once. Use this function if you suspect the state of those
properties to be dirty.

#### refetch\_ontology

```python theme={"dark"}
def refetch_ontology() -> None
```

Update the ontology for the project to reflect changes on the backend.

#### get\_project

```python theme={"dark"}
def get_project() -> OrmProject
```

This function is exposed for convenience. You are encouraged to use the property accessors instead.

#### workflow

```python theme={"dark"}
@property
def workflow() -> Workflow
```

Get the workflow of the project.

Available only for workflow projects.

#### list\_label\_rows\_v2

```python theme={"dark"}
def list_label_rows_v2(
        data_hashes: Optional[Union[List[str], List[UUID]]] = None,
        label_hashes: Optional[Union[List[str], List[UUID]]] = None,
        edited_before: Optional[Union[str, datetime.datetime]] = None,
        edited_after: Optional[Union[str, datetime.datetime]] = None,
        label_statuses: Optional[List[AnnotationTaskStatus]] = None,
        shadow_data_state: Optional[ShadowDataState] = None,
        data_title_eq: Optional[str] = None,
        data_title_like: Optional[str] = None,
        workflow_graph_node_title_eq: Optional[str] = None,
        workflow_graph_node_title_like: Optional[str] = None,
        include_workflow_graph_node: bool = True,
        include_client_metadata: bool = False,
        include_images_data: bool = False,
        include_children: bool = False,
        include_all_label_branches: bool = False,
        branch_name: Optional[str] = None,
        resolve_client_metadata_locally: bool = False) -> List[LabelRowV2]
```

List label rows with various filtering options.

**Arguments**:

* `data_hashes` - List of data hashes to filter by.
* `label_hashes` - List of label hashes to filter by.
* `edited_before` - Optionally filter to only rows last edited before the specified time.
* `edited_after` - Optionally filter to only rows last edited after the specified time.
* `label_statuses` - Optionally filter to only those label rows that have one of the specified [AnnotationTaskStatus](/sdk-documentation/sdk-references/orm.label_row#annotationtaskstatus)es.
* `shadow_data_state` - Optionally filter by data type in Benchmark QA projects. See [ShadowDataState](/sdk-documentation/sdk-references/orm.label_row#shadowdatastate).
* `data_title_eq` - Optionally filter by exact title match.
* `data_title_like` - Optionally filter by fuzzy title match; SQL syntax.
* `workflow_graph_node_title_eq` - Optionally filter by exact match with workflow node title.
* `workflow_graph_node_title_like` - Optionally filter by fuzzy match with workflow node title; SQL syntax.
* `include_workflow_graph_node` - Include workflow graph node metadata in all the results. True by default.
* `include_client_metadata` - Optionally include client metadata into the result of this query.
* `include_images_data` - Optionally include image group metadata into the result of this query.
* `include_children` - Optionally include data group children rows into the result of this query.
* `include_all_label_branches` - Optionally include all label branches. They will be included as separate label row objects.
* `branch_name` - Optionally specify a branch name. A branch name cannot be specified if include\_all\_label\_branches is set to True
* `resolve_client_metadata_locally` - Has no effect unless `include_client_metadata` is set.
  When true, the SDK downloads the metadata client-side instead of the server embedding it directly
  in the response. Use this to prevent server timeouts for projects with large client metadata.

**Returns**:

A list of [LabelRowV2](/sdk-documentation/sdk-references/objects.ontology_labels_impl#labelrowv2) instances for all the matching label rows.

#### list\_branches

```python theme={"dark"}
def list_branches() -> Iterator[str]
```

List all distinct branch names for the project.

The main branch is always named 'main'. Automatically paginates
through all results.

**Returns**:

An iterator of branch name strings.

#### get\_label\_classifications

```python theme={"dark"}
def get_label_classifications(
        label_uuids: List[Union[str, UUID]],
        branch_name: str = "main",
        batch_size: int = 500) -> Iterable[LabelClassificationsEntry]
```

Fast bulk fetch of classification answers only.

**Arguments**:

* `label_uuids` - Label row UUIDs to fetch classifications for.
  Obtain these from [list\_label\_rows\_v2()](/sdk-documentation/sdk-references/project#list_label_rows_v2) (`row.label_hash`).
* `branch_name` - Label branch to read from (default `"main"`).
* `batch_size` - Number of labels per server request (max 1000).

**Returns**:

An iterable of [LabelClassificationsEntry](/sdk-documentation/sdk-references/orm.project#labelclassificationsentry),
one per label row. Each entry contains `classification_answers`
keyed by classification hash.

#### add\_users

```python theme={"dark"}
def add_users(user_emails: List[str],
              user_role: ProjectUserRole) -> List[ProjectUser]
```

Add users to the project.

If the user already exists in the Project, this operation succeeds but the `user_role` remains unchanged. The
existing `user_role` is reflected in the `ProjectUser` instance returned.

**Arguments**:

* `user_emails` - List of user emails to be added.
* `user_role` - The user role to assign to all users.

**Returns**:

* `List[ProjectUser]` - A list of ProjectUser objects representing the added users.

**Raises**:

* `AuthorisationError` - If the project API key is invalid.
* `ResourceNotFoundError` - If no project exists by the specified project EntityId.
* `UnknownError` - If an error occurs while adding the users to the project.

#### list\_users

```python theme={"dark"}
def list_users() -> Iterable[ProjectUser]
```

List all users that have access to the project.

**Returns**:

* `Iterable[ProjectUser]` - An iterable of ProjectUser objects.

#### list\_groups

```python theme={"dark"}
def list_groups() -> Iterable[ProjectGroup]
```

List all groups that have access to a particular project.

**Returns**:

* `Iterable[ProjectGroup]` - An iterable of ProjectGroup objects.

#### add\_group

```python theme={"dark"}
def add_group(group_hash: Union[List[UUID], UUID], user_role: ProjectUserRole)
```

Add a group to the project.

**Arguments**:

* `group_hash` - List of group hashes or a single group hash to be added.
* `user_role` - User role that the group will be given.

**Returns**:

None

#### remove\_group

```python theme={"dark"}
def remove_group(group_hash: Union[List[UUID], UUID])
```

Remove a group from the project.

**Arguments**:

* `group_hash` - List of group hashes or a single group hash to be removed.

**Returns**:

None

#### copy\_project

```python theme={"dark"}
def copy_project(copy_datasets: Union[bool, CopyDatasetOptions] = False,
                 copy_collaborators=False,
                 copy_models=False,
                 *,
                 copy_labels: Optional[CopyLabelsOptions] = None,
                 new_title: Optional[str] = None,
                 new_description: Optional[str] = None) -> str
```

Copy the current project into a new one with copied contents including settings, datasets, and users.
Labels and models are optional.

**Arguments**:

* `copy_datasets` - If True, the datasets of the existing project are copied over, and new tasks are created from those datasets.
* `copy_collaborators` - If True, all users of the existing project are copied over with their current roles.
  If label and/or annotator reviewer mapping is set, this will also be copied over.
* `copy_models` - If True, all models with their training information will be copied into the new project.
* `copy_labels` - Options for copying labels, defined in `CopyLabelsOptions`.
* `new_title` - When provided, will be used as the title for the new project.
* `new_description` - When provided, will be used as the description for the new project.

**Returns**:

* `str` - The EntityId of the newly created project.

**Raises**:

* `AuthorisationError` - If the project API key is invalid.
* `ResourceNotFoundError` - If no project exists by the specified project EntityId.
* `UnknownError` - If an error occurs while copying the project.

#### add\_datasets

```python theme={"dark"}
def add_datasets(dataset_hashes: List[str]) -> bool
```

Add datasets to the project.

**Arguments**:

* `dataset_hashes` - List of dataset hashes of the datasets to be added.

**Returns**:

* `bool` - True if the datasets were successfully added, False otherwise.

**Raises**:

* `AuthenticationError` - If the project API key is invalid.
* `AuthorisationError` - If access to the specified resource is restricted.
* `ResourceNotFoundError` - If one or more datasets don't exist by the specified dataset\_hashes.
* `UnknownError` - If an error occurs while adding the datasets to the project.
* `OperationNotAllowed` - If the write operation is not allowed by the API key.

#### remove\_datasets

```python theme={"dark"}
def remove_datasets(dataset_hashes: List[str]) -> bool
```

Remove datasets from the project.

**Arguments**:

* `dataset_hashes` - List of dataset hashes of the datasets to be removed.

**Returns**:

* `bool` - True if the datasets were successfully removed, False otherwise.

**Raises**:

* `AuthenticationError` - If the project API key is invalid.
* `AuthorisationError` - If access to the specified resource is restricted.
* `ResourceNotFoundError` - If no dataset exists by the specified dataset\_hash (uid).
* `UnknownError` - If an error occurs while removing the datasets from the project.
* `OperationNotAllowed` - If the operation is not allowed by the API key.

#### get\_project\_ontology

```python theme={"dark"}
@deprecated(version="0.1.95", alternative=".ontology_structure")
def get_project_ontology() -> LegacyOntology
```

DEPRECATED: Prefer using the `ontology_structure` property accessor instead.

**Returns**:

* `LegacyOntology` - The project's ontology.

#### add\_object

```python theme={"dark"}
@deprecated("0.1.102", alternative="encord.ontology.Ontology class")
def add_object(name: str, shape: ObjectShape) -> bool
```

DEPRECATED: Prefer using \[Ontology]]\(/sdk-documentation/sdk-references/project#ontology) to manipulate ontology.

Add an object to an ontology.

ATTENTION: This legacy method will affect all the projects sharing the same ontology.

**Arguments**:

* `name` - The name of the object.
* `shape` - The shape of the object. (BOUNDING\_BOX, POLYGON, POLYLINE, or KEY\_POINT)

**Returns**:

* `bool` - True if the object was added successfully, False otherwise.

**Raises**:

* `AuthenticationError` - If the project API key is invalid.
* `AuthorisationError` - If access to the specified resource is restricted.
* `UnknownError` - If an error occurs while adding the object to the project ontology.
* `OperationNotAllowed` - If the operation is not allowed by the API key.
* `ValueError` - If invalid arguments are supplied in the function call.

#### add\_classification

```python theme={"dark"}
@deprecated("0.1.102", alternative="encord.ontology.Ontology class")
def add_classification(name: str,
                       classification_type: ClassificationType,
                       required: bool,
                       options: Optional[Iterable[str]] = None)
```

DEPRECATED: Prefer using [Ontology](/sdk-documentation/sdk-references/ontology#ontology) to manipulate ontology.

Add a classification to an ontology.

ATTENTION: This legacy method will affect all the projects sharing the same ontology.

**Arguments**:

* `name` - The name of the classification.
* `classification_type` - The classification type (RADIO, TEXT, or CHECKLIST).
* `required` - Whether this classification is required by the annotator.
* `options` - The list of options for the classification (to be set to None for texts).

**Raises**:

* `AuthenticationError` - If the project API key is invalid.
* `AuthorisationError` - If access to the specified resource is restricted.
* `UnknownError` - If an error occurs while adding the classification to the project ontology.
* `OperationNotAllowed` - If the operation is not allowed by the API key.
* `ValueError` - If invalid arguments are supplied in the function call.

#### object\_interpolation

```python theme={"dark"}
def object_interpolation(key_frames, objects_to_interpolate)
```

Run object interpolation algorithm on project labels (requires an editor ontology and feature uids).

Interpolation is supported for bounding box, polygon, and keypoint.

**Arguments**:

* `key_frames` - Labels for frames to be interpolated. Key frames are consumed in the form::

  ```python theme={"dark"}
      {
          "[frame_number]": {
              "objects": [
                  {
                      "objectHash": "[object_hash]",
                      "featureHash": "[feature_hash]",
                      "polygon": {
                          "0": { "x": x1, "y": y1, },
                          "1": { "x": x2, "y": y2, },
                          # ...,
                      }
                  },
                  # ...
              ]
          },
          # ...,
      }
  ```

* `objects_to_interpolate` - List of object uids (hashes) of objects to interpolate.

**Returns**:

* `dict` - Full set of filled frames including interpolated objects.

**Raises**:

* `AuthenticationError` - If the project API key is invalid.
* `AuthorisationError` - If access to the specified resource is restricted.
* `UnknownError` - If an error occurs while running interpolation.

#### get\_data

```python theme={"dark"}
def get_data(
    data_hash: str,
    get_signed_url: bool = False
) -> Tuple[Optional[Video], Optional[List[Image]]]
```

Retrieve information about a video or image group.

**Arguments**:

* `data_hash` - The uid of the data object.
* `get_signed_url` - Optionally return signed URLs for timed public access to that resource (default False).

**Returns**:

A tuple consisting of the video (if it exists) and a list of individual images (if they exist).

**Raises**:

* `AuthenticationError` - If the project API key is invalid.
* `AuthorisationError` - If access to the specified resource is restricted.
* `UnknownError` - If an error occurs while retrieving the object.

#### get\_label\_logs

```python theme={"dark"}
@deprecated(version="0.1.187", alternative=".get_editor_logs")
def get_label_logs(user_hash: Optional[str] = None,
                   data_hash: Optional[str] = None,
                   from_unix_seconds: Optional[int] = None,
                   to_unix_seconds: Optional[int] = None,
                   after: Optional[datetime.datetime] = None,
                   before: Optional[datetime.datetime] = None,
                   user_email: Optional[str] = None) -> List[LabelLog]
```

DEPRECATED: Use [get\_editor\_logs()](/sdk-documentation/sdk-references/project#get_editor_logs)  instead.

Get label logs, which represent the actions taken in the UI to create labels.

All arguments can be left as `None` if no filtering should be applied.

**Arguments**:

* `user_hash` - Filter the label logs by the user.
* `data_hash` - Filter the label logs by the data\_hash.
* `from_unix_seconds` - Filter the label logs to only include labels after this timestamp. **Deprecated**: use parameter **after** instead.
* `to_unix_seconds` - Filter the label logs to only include labels before this timestamp. **Deprecated**: use parameter **before** instead.
* `after` - Filter the label logs to only include labels after the specified time.
* `before` - Filter the label logs to only include labels before the specified time.
* `user_email` - Filter by the annotator email.

**Returns**:

List of label logs.

**See Also**:

* `get_editor_logs` - Replacement for retrieving activity logs.

#### get\_editor\_logs

```python theme={"dark"}
def get_editor_logs(
        start_time: datetime.datetime,
        end_time: datetime.datetime,
        action: Optional[str] = None,
        actor_user_email: Optional[str] = None,
        workflow_stage_id: Optional[UUID] = None,
        data_unit_id: Optional[UUID] = None) -> Iterator[EditorLog]
```

Get editor logs, represents the actions taken in the Editor UI.

The start\_time and end\_time parameters are required. The maximum time range is 30 days.

**Arguments**:

* `action` - Filter the editor logs by action.
* `actor_user_email` - Filter the editor logs by the user email.
* `data_unit_id` - Filter the editor logs by the data id (data\_hash).
* `workflow_stage_id` - Filter the editor logs by the workflow stage id.
* `end_time` - Filter the editor logs to only include logs before the specified time.
* `start_time` - Filter the editor logs to only include logs after the specified time.

**Returns**:

An iterator on the editor logs.

#### get\_cloud\_integrations

```python theme={"dark"}
@deprecated(version="0.1.154",
            alternative="EncordUserClient.get_cloud_integrations")
def get_cloud_integrations() -> List[CloudIntegration]
```

Get the list of cloud integrations.

**Returns**:

List of CloudIntegration objects.

#### list\_label\_rows

```python theme={"dark"}
@deprecated(version="0.1.104", alternative=".list_label_rows_v2")
def list_label_rows(
        edited_before: Optional[Union[str, datetime.datetime]] = None,
        edited_after: Optional[Union[str, datetime.datetime]] = None,
        label_statuses: Optional[List[AnnotationTaskStatus]] = None,
        shadow_data_state: Optional[ShadowDataState] = None,
        *,
        include_uninitialised_labels=False,
        label_hashes: Optional[List[str]] = None,
        data_hashes: Optional[List[str]] = None) -> List[LabelRowMetadata]
```

DEPRECATED - use [list\_label\_rows\_v2()](/sdk-documentation/sdk-references/project#list_label_rows_v2) to manage label rows instead.

**Arguments**:

* `edited_before` - Optionally filter to only rows last edited before the specified time.
* `edited_after` - Optionally filter to only rows last edited after the specified time.
* `label_statuses` - Optionally filter to only those label rows that have one of the specified AnnotationTaskStatus.
* `shadow_data_state` - Optionally filter by data type in Benchmark QA projects. See ShadowDataState.
* `include_uninitialised_labels` - Whether to return only label rows that are "created" and have a label\_hash (default).
  If set to `True`, this will return all label rows, including those that do not have a label\_hash.
* `data_hashes` - List of data hashes to filter by.
* `label_hashes` - List of label hashes to filter by.

**Returns**:

A list of LabelRowMetadata instances for all the matching label rows.

**Raises**:

* `UnknownError` - If an error occurs while retrieving the data.

#### get\_label\_row

```python theme={"dark"}
@deprecated(version="0.1.123", alternative=".list_label_rows_v2")
def get_label_row(uid: str,
                  get_signed_url: bool = True,
                  *,
                  include_object_feature_hashes: Optional[Set[str]] = None,
                  include_classification_feature_hashes: Optional[
                      Set[str]] = None,
                  include_reviews: bool = False) -> LabelRow
```

DEPRECATED: Use the [list\_label\_rows\_v2()](/sdk-documentation/sdk-references/project#list_label_rows_v2) function to interact with label rows.

Retrieve label row. If you need to retrieve multiple label rows, prefer using get\_label\_rows instead.

**Arguments**:

* `uid` - A label\_hash (uid) string.
* `get_signed_url` - Whether to generate signed urls to the data asset. Generating these should be disabled if the signed urls are not used to speed up the request.
* `include_object_feature_hashes` - If None all the objects will be included. Otherwise, only objects labels will be included of which the feature\_hash has been added.
* `include_classification_feature_hashes` - If None all the classifications will be included. Otherwise, only classification labels will be included of which the feature\_hash has been added.
* `include_reviews` - Whether to request read only information about the reviews of the label row.

**Returns**:

* `LabelRow` - A label row instance.

**Raises**:

* `AuthenticationError` - If the project API key is invalid.
* `AuthorisationError` - If access to the specified resource is restricted.
* `ResourceNotFoundError` - If no label exists by the specified label\_hash (uid).
* `UnknownError` - If an error occurs while retrieving the label.
* `OperationNotAllowed` - If the read operation is not allowed by the API key.

#### get\_label\_rows

```python theme={"dark"}
@deprecated(version="0.1.123", alternative=".list_label_rows_v2")
def get_label_rows(uids: List[str],
                   get_signed_url: bool = True,
                   *,
                   include_object_feature_hashes: Optional[Set[str]] = None,
                   include_classification_feature_hashes: Optional[
                       Set[str]] = None,
                   include_reviews: bool = False) -> List[LabelRow]
```

DEPRECATED: Use the [list\_label\_rows\_v2()](/sdk-documentation/sdk-references/project#list_label_rows_v2)function to interact with label rows.

Retrieve a list of label rows. Duplicates will be dropped. The result will come back in a random order.

**Arguments**:

* `uids` - A list of label\_hash (uid).
* `get_signed_url` - Whether to generate signed urls to the data asset. Generating these should be disabled if the signed urls are not used to speed up the request.
* `include_object_feature_hashes` - If None all the objects will be included. Otherwise, only objects labels will be included of which the feature\_hash has been added.
* `include_classification_feature_hashes` - If None all the classifications will be included. Otherwise, only classification labels will be included of which the feature\_hash has been added.
* `include_reviews` - Whether to request read only information about the reviews of the label row.

**Returns**:

List of LabelRow instances.

**Raises**:

* `MultiLabelLimitError` - If too many labels were requested. Check the error's maximum\_labels\_allowed field to read the most up to date error limit.
* `AuthenticationError` - If the project API key is invalid.
* `AuthorisationError` - If access to the specified resource is restricted.
* `ResourceNotFoundError` - If no label exists by the specified label\_hash (uid).
* `UnknownError` - If an error occurs while retrieving the label.
* `OperationNotAllowed` - If the read operation is not allowed by the API key.

#### get\_tags

```python theme={"dark"}
def get_tags(use_cache: bool = True) -> List[ProjectTag]
```

Get the tags assigned to the project.

**Arguments**:

* `use_cache` - If `True` (default), returns the cached result from a previous call.
  Set to `False` to force a fresh fetch from the API.

**Returns**:

* `List[ProjectTag]` - The tags assigned to this project.

#### get\_issue\_tags

```python theme={"dark"}
def get_issue_tags() -> Iterable[IssueTag]
```

Get the issue tags linked to a Project.

**Returns**:

* `List[IssueTag]` - The issue tags linked to a Project.

#### add\_issue\_tags

```python theme={"dark"}
def add_issue_tags(issue_tag_names: List[str]) -> None
```

Link existing workspace-level issue tags to a Project by name.

**Arguments**:

* `issue_tag_names` - List of issue tag names to link to a Project.

**Returns**:

None

#### save\_label\_row

```python theme={"dark"}
@deprecated(version="0.1.123", alternative=".list_label_rows_v2")
def save_label_row(uid, label, validate_before_saving: bool = False)
```

DEPRECATED: Use the [list\_label\_rows\_v2()](/sdk-documentation/sdk-references/project#list_label_rows_v2) function to interact with label rows.

Save an existing label row.

If you have a series of frame labels and have not updated answer
dictionaries, call the construct\_answer\_dictionaries utility function
to do so prior to saving labels.

**Arguments**:

* `uid` - A label\_hash (uid) string.
* `label` - A label row instance.
* `validate_before_saving` - Enable stricter server-side integrity checks. Boolean, `False` by default.

**Returns**:

* `bool` - True if the label row is successfully saved, False otherwise.

**Raises**:

* `AuthenticationError` - If the project API key is invalid.
* `AuthorisationError` - If access to the specified resource is restricted.
* `ResourceNotFoundError` - If no label exists by the specified label\_hash (uid).
* `UnknownError` - If an error occurs while saving the label.
* `OperationNotAllowed` - If the write operation is not allowed by the API key.
* `AnswerDictionaryError` - If an object or classification instance is missing in answer dictionaries.
* `CorruptedLabelError` - If a blurb is corrupted (e.g., if the frame labels have more frames than the video).

#### create\_label\_row

```python theme={"dark"}
@deprecated(version="0.1.123", alternative=".list_label_rows_v2")
def create_label_row(uid: str)
```

DEPRECATED: Use the [list\_label\_rows\_v2()](/sdk-documentation/sdk-references/project#list_label_rows_v2) function to interact with label rows.

Create a label row (for data in a project not previously labeled).

**Arguments**:

* `uid` - The data\_hash (uid) of the data unit being labeled.
  Available in client.get\_project().get('label\_rows')
  where label\_status is NOT\_LABELLED.

**Returns**:

* `LabelRow` - A label row instance.

**Raises**:

* `AuthenticationError` - If the project API key is invalid.
* `AuthorisationError` - If access to the specified resource is restricted.
* `UnknownError` - If an error occurs while saving the label.
* `OperationNotAllowed` - If the write operation is not allowed by the API key.
* `AnswerDictionaryError` - If an object or classification instance is missing in answer dictionaries.
* `CorruptedLabelError` - If a blurb is corrupted (e.g., if the frame labels have more frames than the video).
* `ResourceExistsError` - If a label row already exists for this project data. Avoids overriding existing work.

#### create\_bundle

```python theme={"dark"}
def create_bundle(bundle_size: Optional[int] = None) -> Bundle
```

Initializes a bundle to reduce the number of network calls performed by the Encord SDK.

See the [Bundle](/sdk-documentation/sdk-references/http.bundle#bundle) documentation for more details.

**Arguments**:

* `bundle_size` - maximum number of items bundled. If more actions provided to the bundle, they will be
  automatically split into separate api calls.

**Returns**:

* `Bundle` - An instance of the Bundle class.

#### list\_collaborator\_timers

```python theme={"dark"}
@deprecated(version="0.1.157", alternative=".list_time_spent")
def list_collaborator_timers(
        after: datetime.datetime,
        before: Optional[datetime.datetime] = None,
        group_by_data_unit: bool = True) -> Iterable[CollaboratorTimer]
```

**DEPRECATED** - Use `list_time_spent`. `list_time_spent` provides more comprehensive and accurate information.

Provides information about time spent by each collaborator who has worked on the project within a specified range of dates.

This endpoint is deprecated and retrieves collaborator timers from the Legacy Performance Dashboards, not the Upgraded Analytics Dashboard.

**Arguments**:

* `after` - The beginning of the period of interest.
* `before` - The end of the period of interest.
* `group_by_data_unit` - If True, time spent by a collaborator for each data unit is provided separately.
  If False, all time spent in the scope of the project is aggregated together.

**Yields**:

* `CollaboratorTimer` - Information about the time spent by each collaborator.

#### list\_time\_spent

```python theme={"dark"}
def list_time_spent(
        start: datetime.datetime,
        end: Optional[datetime.datetime] = None,
        workflow_stage_uuid: Union[List[UUID], List[str], UUID, str,
                                   None] = None,
        user_email: Union[List[str], str, None] = None) -> Iterable[TimeSpent]
```

Get time spent by collaborators on a task per day. If a task spans multiple days, the time spent on each day will be returned separately.

**Arguments**:

* `start` - The beginning of the period of interest.
* `end` - The end of the period of interest.
* `workflow_stage_uuid` - The UUID or list of UUIDs of the workflow stages of interest.
* `user_email` - The email or list of emails of the users of interest.

**Returns**:

* `Iterable[TimeSpent]` - Information about the time spent by a collaborator on a task per day.

#### get\_task\_actions

```python theme={"dark"}
def get_task_actions(
    *,
    after: datetime.datetime,
    before: Optional[datetime.datetime] = None,
    actor_email: Union[str, List[str], None] = None,
    action_type: Union[TaskActionType, List[TaskActionType], None] = None,
    workflow_stage_uuid: Union[UUID, List[UUID], str, List[str], None] = None,
    data_unit_uuid: Union[UUID, List[UUID], str, List[str], None] = None
) -> Iterable[TaskAction]
```

Retrieve task action events for this Project.

Returns an iterator of task actions with automatic pagination handling.
Before defaults to current time if not provided.

Task actions represent lifecycle events such as assignment, approval, submission,
rejection, etc. for tasks in the Project.

**Arguments**:

* `after` - Start time for the query (required). Only events on or after this time are returned.
* `before` - End time for the query (defaults to current time). Only events before this time are returned.
* `actor_email` - Filter by user email address(es) who performed the action.
  Can be a single string, list of strings, or None.
* `action_type` - Filter by action type (ASSIGN, SUBMIT, APPROVE, etc.).
  Can be a single TaskActionType, list, or None.
* `workflow_stage_uuid` - Filter by workflow stage UUID(s).
  Can be a single UUID, string, list, or None.
* `data_unit_uuid` - Filter by data unit UUID(s).
  Can be a single UUID, string, list, or None.

**Returns**:

* `Iterable[TaskAction]` - An iterator of task action objects with automatic pagination.

**Example**:

```python theme={"dark"}
from datetime import datetime, timedelta
seven_days_ago = datetime.now() - timedelta(days=7)
for action in project.get_task_actions(after=seven_days_ago):
    print(f"{action.action_type} by {action.actor_email}")
```

#### list\_datasets

```python theme={"dark"}
def list_datasets() -> Iterable[ProjectDataset]
```

List all datasets associated with the project.

**Returns**:

* `Iterable[ProjectDataset]` - An iterable of ProjectDataset instances.

#### import\_coco\_labels

```python theme={"dark"}
def import_coco_labels(labels_dict: Dict[str, Any],
                       category_id_to_feature_hash: Dict[CategoryID, str],
                       image_id_to_frame_index: Dict[ImageID, FrameIndex],
                       branch_name: Optional[str] = None,
                       confidence_field_name: Optional[str] = None) -> None
```

Import labels in COCO format to an Encord Project.

**Arguments**:

* `labels_dict` *Dict\[str, Any]* - A dictionary in COCO annotation format.
* `category_id_to_feature_hash` *Dict\[CategoryID, str]* - A mapping of category IDs from the COCO data to their corresponding feature hashes in the Project's Ontology.
* `image_id_to_frame_index` *Dict\[ImageID, FrameIndex]* - A mapping of image IDs to FrameIndex(data\_hash, frame\_offset), used to locate the corresponding frames in the Encord Project.
* `branch_name` *Optional\[str]* - Optionally specify a branch name. Defaults to the `main` branch.
* `confidence_field_name` *Optional\[str]* - Optionally specify the name of the confidence field in the COCO annotations. Defaults to assigning `1.0` as confidence value to all annotations.

#### export\_coco\_labels

```python theme={"dark"}
def export_coco_labels(
        label_hashes: Optional[List[str]] = None,
        include_object_feature_hashes: Optional[Set[str]] = None,
        include_classification_feature_hashes: Optional[Set[str]] = None,
        branch_name: Optional[str] = None) -> Dict[str, Any]
```

Export labels from the project to the COCO format.
This method requires the 'coco' extra to be installed. Install it using:
`pip install encord[coco]`.

**Arguments**:

* `label_hashes` - List of label hashes to include. If not provided, all label rows will be included.
* `include_object_feature_hashes` - If `None`, all objects will be included.
  Otherwise, only objects with the specified feature hashes will be included.
* `include_classification_feature_hashes` - If `None`, all classifications will be included.
  Otherwise, only classifications with the specified feature hashes will be included.
* `branch_name` - Optionally specify a branch name. Defaults to the `main` branch.

**Returns**:

Dict\[str, Any]: A dictionary in the COCO format containing the exported labels,
including annotations and metadata conforming to COCO standards.
The dictionary also includes additional fields specific to Encord,
providing supplementary information not defined in the COCO standard.

**Raises**:

* `ImportError` - If the 'coco' extra dependencies are not installed.

#### list\_collections

```python theme={"dark"}
def list_collections(
        collection_uuids: Optional[List[Union[str, UUID]]] = None,
        page_size: Optional[int] = None) -> Iterator[ProjectCollection]
```

List all collections associated to the project.

**Arguments**:

* `collection_uuids` - The unique identifiers (UUIDs) of the collections to retrieve.
* `page_size` *int* - Number of items to return per page.  Default if not specified is 100. Maximum value is 1000.

**Returns**:

The list of collections which match the given criteria.

**Raises**:

* `ValueError` - If any of the collection uuids is a badly formed UUID.
  [AuthorisationError](/sdk-documentation/sdk-references/exceptions#authorisationerror) : If the user does not have access to it.

#### delete\_collection

```python theme={"dark"}
def delete_collection(collection_uuid: Union[str, UUID]) -> None
```

Delete a project collection by its UUID if it exists.

**Arguments**:

* `collection_uuid` - The unique identifier (UUID) of the collection to delete.

**Returns**:

None

**Raises**:

* `ValueError` - If `collection_uuid` is a badly formed UUID.
  [AuthorisationError](/sdk-documentation/sdk-references/exceptions#authorisationerror) : If the user does not have access to it.

#### create\_collection

```python theme={"dark"}
def create_collection(
    name: str,
    description: str = "",
    collection_type: ProjectCollectionType = ProjectCollectionType.FRAME
) -> ProjectCollection
```

Create a project collection.

**Arguments**:

* `name` - The name of the collection.
* `description` - The description of the collection.
* `collection_type` - The type of the collection, could be either frame or label.

**Returns**:

* `ProjectCollection` - Newly created collection.

**Raises**:

[AuthorisationError](/sdk-documentation/sdk-references/exceptions#authorisationerror) : If the user does not have access to the folder.

#### active\_sync

```python theme={"dark"}
def active_sync() -> None
```

Sync the associated Active project

#### active\_import

```python theme={"dark"}
def active_import(project_mode: ActiveProjectMode,
                  *,
                  video_sampling_rate: Optional[float] = None) -> None
```

Import the associated Active project. Progress in the app

**Arguments**:

* `project_mode` - Active projects can be imported up to a certain stage. Use the ActiveProjectModeEnum to select the stage
* `video_sampling_rate` - Optional\[float]: For videos, what's the sampling rate of frames for analysis

**Returns**:

None

#### list\_filter\_presets

```python theme={"dark"}
def list_filter_presets(
        filter_preset_uuids: Optional[List[Union[str, UUID]]] = None,
        page_size: Optional[int] = None) -> Iterator[ProjectFilterPreset]
```

List all filter presets associated to the project.

**Arguments**:

* `filter_preset_uuids` - The unique identifiers (UUIDs) of the filter presets to retrieve.
* `page_size` *int* - Number of items to return per page.  Default if not specified is 100. Maximum value is 1000.

**Returns**:

The list of filter presets which match the given criteria.

**Raises**:

* `ValueError` - If any of the filter preset uuids is a badly formed UUID.
  [AuthorisationError](/sdk-documentation/sdk-references/exceptions#authorisationerror) : If the user does not have access to it.

#### copy\_labels\_to\_branch

```python theme={"dark"}
def copy_labels_to_branch(target_branch: str,
                          source_branch: str = "main",
                          overwrite: bool = False,
                          data_hashes: Optional[Union[List[str],
                                                      List[UUID]]] = None,
                          label_hashes: Optional[Union[List[str],
                                                       List[UUID]]] = None,
                          batch_size: int = 50) -> int
```

Copy label rows for a project from one branch into another branch.

Matching label rows on the source branch are listed first (metadata only), then
copied to the target branch in batches of `batch_size` to avoid excessive database
load. Use [list\_label\_rows\_v2()](/sdk-documentation/sdk-references/project#list_label_rows_v2) with `branch_name=target_branch` to verify
the result.

**Arguments**:

* `target_branch` - The name of the branch to copy labels into.
* `source_branch` - The name of the branch to copy labels from. Defaults to `"main"`.
* `overwrite` - If `True`, existing label rows on the target branch are overwritten
  with the source content. If `False` (default), data units that already have
  a label row on the target branch are skipped.
* `data_hashes` - Optionally restrict which data units are copied. Accepts any number
  of strings or uuid objects. If `None`, all data units on the
  source branch are copied.
* `label_hashes` - Optionally restrict which label rows are copied by their label hash.
  Accepts any number of strings or uuid objects. Applied after
  `data_hashes` filtering. If `None`, all matching label rows are copied.
* `batch_size` - Number of label rows to copy per API request. Defaults to `50`.
  Increase for projects with small labels; decrease if you encounter timeouts.

**Returns**:

The total number of label rows created or updated on the target branch.

**Raises**:

* `ValueError` - If `source_branch` and `target_branch` are the same.

#### set\_status

```python theme={"dark"}
def set_status(status: ProjectStatus)
```

Set the status of the project.

**Arguments**:

* `status` - The new status of the project.
