Skip to main content
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

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

EncordClientDataset Objects

DEPRECATED - prefer using the Dataset instead

get_dataset

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

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

This function is documented in add_users().

upload_video

This function is documented in upload_video().

create_image_group

This function is documented in create_image_group().

create_dicom_series

This function is documented in create_dicom_series().

upload_image

This function is documented in upload_image().
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

delete_data

This function is documented in delete_data().

add_private_data_to_dataset

This function is documented in add_private_data_to_dataset().

add_private_data_to_dataset_start

This function is documented in add_private_data_to_dataset_start().

add_private_data_to_dataset_get_result

This function is documented in add_private_data_to_dataset_get_result().

update_data_item

This function is documented in update_data_item().

re_encode_data

This function is documented in re_encode_data().

re_encode_data_status

This function is documented in re_encode_data_status().

run_ocr

This function is documented in run_ocr().

EncordClientProject Objects

DEPRECATED - prefer using the Project instead

get_project

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

This is an internal method, do not use it directly. Use get_project() instead.

list_label_rows

This function is documented in list_label_rows().

add_users

This function is documented in add_users().

copy_project

This function is documented in copy_project().

get_label_row

This function is documented in get_label_row().

get_label_rows

This function is documented in get_label_rows().

save_label_row

This function is documented in save_label_row().

save_label_rows

This function is meant for internal use, please consider using LabelRowV2 class instead Saves multiple label rows. See save_label_row() Arguments:
  • uids - list of label hashes
  • payload - list of LabelRow objects
  • validate_before_saving - ????
Returns: None

create_label_row

This function is documented in create_label_row().

create_label_rows

This function is meant for internal use, please consider using LabelRowV2 class instead Create multiple label rows. See 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

This function is documented in add_datasets().

remove_datasets

This function is documented in remove_datasets().

add_object

This function is documented in add_object().

add_classification

This function is documented in add_classification().

object_interpolation

This function is documented in object_interpolation().

get_data

This function is documented in get_data().

get_label_logs

This function is documented in get_label_logs().

workflow_reopen

This function is documented in workflow_reopen().

workflow_complete

This function is documented in workflow_complete().