> ## 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.

# Client

`encord.client` provides a simple Python client that allows you
to query project resources through the Encord API.

Here is a simple example for instantiating the client for a project
and obtaining project info:

.. test\_blurb2.py code::

from encord.client import EncordClient

client = EncordClient.initialize('YourProjectID', 'YourAPIKey')
client.get\_project()

**Returns**:

* `Project` - A project record instance. See Project ORM for details.

## EncordClient Objects

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

Encord client. Allows you to query db items associated
with a project (e.g. label rows, datasets).

## EncordClientDataset Objects

```python theme={"dark"}
class EncordClientDataset(EncordClient)
```

DEPRECATED - prefer using the [Dataset](/sdk-documentation/sdk-references/dataset#dataset) instead

#### get\_dataset

```python theme={"dark"}
def get_dataset() -> OrmDataset
```

Retrieve dataset info (pointers to data, labels).

**Returns**:

* `OrmDataset` - A dataset record instance.

**Raises**:

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

#### list\_data\_rows

```python theme={"dark"}
def list_data_rows(title_eq: Optional[str] = None,
                   title_like: Optional[str] = None,
                   created_before: Optional[Union[str, datetime]] = None,
                   created_after: Optional[Union[str, datetime]] = None,
                   data_types: Optional[List[DataType]] = None,
                   data_hashes: Optional[List[str]] = None) -> List[DataRow]
```

Retrieve dataset rows (pointers to data, labels).

**Arguments**:

* `title_eq` - optional exact title row filter
* `title_like` - optional fuzzy title row filter; SQL syntax
* `created_before` - optional datetime row filter
* `created_after` - optional datetime row filter
* `data_types` - optional data types row filter
* `data_hashes` - optional list of individual data unit hashes to include

**Returns**:

* `List[DataRow]` - A list of DataRows object that match the filter

**Raises**:

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

#### add\_users

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

This function is documented in [add\_users()](/sdk-documentation/sdk-references/project#add_users).

#### upload\_video

```python theme={"dark"}
def upload_video(
        file_path: Union[str, Path],
        cloud_upload_settings: CloudUploadSettings = CloudUploadSettings(),
        title: Optional[str] = None,
        folder_uuid: Optional[uuid.UUID] = None) -> Video
```

This function is documented in [upload\_video()](/sdk-documentation/sdk-references/dataset#upload_video).

#### create\_image\_group

```python theme={"dark"}
def create_image_group(
        file_paths: Iterable[Union[str, Path]],
        max_workers: Optional[int] = None,
        cloud_upload_settings: CloudUploadSettings = CloudUploadSettings(),
        title: Optional[str] = None,
        *,
        create_video: bool = True,
        folder_uuid: Optional[uuid.UUID] = None) -> List[ImageGroup]
```

This function is documented in [create\_image\_group()](/sdk-documentation/sdk-references/dataset#create_image_group).

#### create\_dicom\_series

```python theme={"dark"}
def create_dicom_series(
        file_paths: Union[typing.Collection[str], typing.Collection[Path],
                          typing.Collection[Union[str, Path]]],
        title: Optional[str] = None,
        cloud_upload_settings: CloudUploadSettings = CloudUploadSettings(),
        folder_uuid: Optional[uuid.UUID] = None) -> Dict
```

This function is documented in [create\_dicom\_series()](/sdk-documentation/sdk-references/dataset#create_dicom_series).

#### upload\_image

```python theme={"dark"}
def upload_image(
        file_path: Union[Path, str],
        title: Optional[str] = None,
        cloud_upload_settings: CloudUploadSettings = CloudUploadSettings(),
        folder_uuid: Optional[uuid.UUID] = None) -> Image
```

This function is documented in [upload\_image()](/sdk-documentation/sdk-references/dataset#upload_image).

#### link\_items

```python theme={"dark"}
def link_items(
    item_uuids: List[uuid.UUID],
    duplicates_behavior: DataLinkDuplicatesBehavior = DataLinkDuplicatesBehavior
    .SKIP
) -> List[DataRow]
```

Link storage items to the dataset, creating new data rows.

**Arguments**:

* `item_uuids` - List of item UUIDs to link to the dataset
* `duplicates_behavior` - The behavior to follow when encountering duplicates. Defaults to `SKIP`. See also
  [DataLinkDuplicatesBehavior](/sdk-documentation/sdk-references/orm.dataset#datalinkduplicatesbehavior)

#### delete\_data

```python theme={"dark"}
def delete_data(data_hashes: Union[List[str], str])
```

This function is documented in [delete\_data()](/sdk-documentation/sdk-references/dataset#delete_data).

#### add\_private\_data\_to\_dataset

```python theme={"dark"}
def add_private_data_to_dataset(
        integration_id: str,
        private_files: Union[str, typing.Dict, Path, typing.TextIO],
        ignore_errors: bool = False) -> AddPrivateDataResponse
```

This function is documented in [add\_private\_data\_to\_dataset()](/sdk-documentation/sdk-references/dataset#add_private_data_to_dataset).

#### add\_private\_data\_to\_dataset\_start

```python theme={"dark"}
def add_private_data_to_dataset_start(
        integration_id: str,
        private_files: Union[str, typing.Dict, Path, typing.TextIO],
        ignore_errors: bool = False,
        folder_uuid: Optional[uuid.UUID] = None) -> str
```

This function is documented in [add\_private\_data\_to\_dataset\_start()](/sdk-documentation/sdk-references/dataset#add_private_data_to_dataset_start).

#### add\_private\_data\_to\_dataset\_get\_result

```python theme={"dark"}
def add_private_data_to_dataset_get_result(
        upload_job_id: str,
        timeout_seconds: int = 7 * 24 * 60 * 60) -> DatasetDataLongPolling
```

This function is documented in [add\_private\_data\_to\_dataset\_get\_result()](/sdk-documentation/sdk-references/dataset#add_private_data_to_dataset_get_result).

#### update\_data\_item

```python theme={"dark"}
def update_data_item(data_hash: str, new_title: str) -> bool
```

This function is documented in [update\_data\_item()](/sdk-documentation/sdk-references/dataset#update_data_item).

#### re\_encode\_data

```python theme={"dark"}
def re_encode_data(data_hashes: List[str])
```

This function is documented in [re\_encode\_data()](/sdk-documentation/sdk-references/dataset#re_encode_data).

#### re\_encode\_data\_status

```python theme={"dark"}
def re_encode_data_status(job_id: int)
```

This function is documented in [re\_encode\_data\_status()](/sdk-documentation/sdk-references/dataset#re_encode_data_status).

#### run\_ocr

```python theme={"dark"}
def run_ocr(image_group_id: str) -> List[ImageGroupOCR]
```

This function is documented in [run\_ocr()](/sdk-documentation/sdk-references/dataset#run_ocr).

## EncordClientProject Objects

```python theme={"dark"}
class EncordClientProject(EncordClient)
```

DEPRECATED - prefer using the [Project](/sdk-documentation/sdk-references/project#project) instead

#### get\_project

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

Retrieve project info (pointers to data, labels).

**Arguments**:

* `include_labels_metadata` - if false, label row metadata information will not be returned.

**Returns**:

* `OrmProject` - A project record instance.

**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 retrieving the project.

#### get\_project\_v2

```python theme={"dark"}
def get_project_v2() -> ProjectOrmV2
```

This is an internal method, do not use it directly.
Use [get\_project()](/sdk-documentation/sdk-references/user_client#get_project) instead.

#### list\_label\_rows

```python theme={"dark"}
def list_label_rows(
        edited_before: Optional[Union[str, datetime]] = None,
        edited_after: Optional[Union[str, datetime]] = None,
        label_statuses: Optional[List[AnnotationTaskStatus]] = None,
        shadow_data_state: Optional[ShadowDataState] = None,
        *,
        include_uninitialised_labels: bool = False,
        include_workflow_graph_node: bool = True,
        include_client_metadata: bool = False,
        include_images_data: bool = False,
        include_children: bool = False,
        label_hashes: Optional[Union[List[str], List[UUID]]] = None,
        data_hashes: Optional[Union[List[str], List[UUID]]] = 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_all_label_branches: bool = False,
        branch_name: Optional[str] = None,
        client_metadata_as_signed_url: bool = False) -> List[LabelRowMetadata]
```

This function is documented in [list\_label\_rows()](/sdk-documentation/sdk-references/project#list_label_rows).

#### add\_users

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

This function is documented in [add\_users()](/sdk-documentation/sdk-references/project#add_users).

#### 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
```

This function is documented in [copy\_project()](/sdk-documentation/sdk-references/project#copy_project).

#### get\_label\_row

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

This function is documented in [get\_label\_row()](/sdk-documentation/sdk-references/project#get_label_row).

#### get\_label\_rows

```python theme={"dark"}
def get_label_rows(uids: List[str],
                   get_signed_url: bool = True,
                   *,
                   include_object_feature_hashes: Optional[
                       typing.Set[str]] = None,
                   include_classification_feature_hashes: Optional[
                       typing.Set[str]] = None,
                   include_reviews: bool = False,
                   include_export_history: bool = False,
                   include_archived: bool = False) -> List[LabelRow]
```

This function is documented in [get\_label\_rows()](/sdk-documentation/sdk-references/project#get_label_rows).

#### save\_label\_row

```python theme={"dark"}
def save_label_row(uid, label, validate_before_saving: bool = False)
```

This function is documented in [save\_label\_row()](/sdk-documentation/sdk-references/project#save_label_row).

#### save\_label\_rows

```python theme={"dark"}
def save_label_rows(uids: List[str],
                    payload: List[LabelRow],
                    validate_before_saving: bool = False)
```

This function is meant for internal use, please consider using [LabelRowV2](/sdk-documentation/sdk-references/objects.ontology_labels_impl#labelrowv2) class instead

Saves multiple label rows. See [save\_label\_row()](/sdk-documentation/sdk-references/client#save_label_row)

**Arguments**:

* `uids` - list of label hashes
* `payload` - list of LabelRow objects
* `validate_before_saving` - ????

**Returns**:

None

#### create\_label\_row

```python theme={"dark"}
def create_label_row(uid, *, get_signed_url=False) -> LabelRow
```

This function is documented in [create\_label\_row()](/sdk-documentation/sdk-references/project#create_label_row).

#### create\_label\_rows

```python theme={"dark"}
def create_label_rows(uids: List[str],
                      *,
                      get_signed_url: bool = False,
                      branch_name: Optional[str] = None) -> List[LabelRow]
```

This function is meant for internal use, please consider using [LabelRowV2](/sdk-documentation/sdk-references/objects.ontology_labels_impl#labelrowv2) class instead

Create multiple label rows. See [create\_label\_row()](/sdk-documentation/sdk-references/client#create_label_row)

**Arguments**:

* `uids` - list of data uids where label\_status is NOT\_LABELLED.
* `get_signed_url` - bool whether to fetch the signed url for the internal label row
* `branch_name` - Optional\[str] which branch name against which to create the label row

**Returns**:

* `List[LabelRow]` - A list of created label rows

#### add\_datasets

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

This function is documented in [add\_datasets()](/sdk-documentation/sdk-references/project#add_datasets).

#### remove\_datasets

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

This function is documented in [remove\_datasets()](/sdk-documentation/sdk-references/project#remove_datasets).

#### add\_object

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

This function is documented in [add\_object()](/sdk-documentation/sdk-references/project#add_object).

#### 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)
```

This function is documented in [add\_classification()](/sdk-documentation/sdk-references/project#add_classification).

#### object\_interpolation

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

This function is documented in [object\_interpolation()](/sdk-documentation/sdk-references/project#object_interpolation).

#### get\_data

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

This function is documented in [get\_data()](/sdk-documentation/sdk-references/project#get_data).

#### get\_label\_logs

```python theme={"dark"}
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] = None,
                   before: Optional[datetime] = None,
                   user_email: Optional[str] = None) -> List[LabelLog]
```

This function is documented in [get\_label\_logs()](/sdk-documentation/sdk-references/project#get_label_logs).

#### workflow\_reopen

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

This function is documented in [workflow\_reopen()](/sdk-documentation/sdk-references/objects.ontology_labels_impl#workflow_reopen).

#### workflow\_complete

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

This function is documented in [workflow\_complete()](/sdk-documentation/sdk-references/objects.ontology_labels_impl#workflow_complete).
