From a43c001366f33507330aa43bdd9277cf62a4f8ad Mon Sep 17 00:00:00 2001 From: kmkkiii Date: Wed, 14 Jan 2026 11:24:03 +0900 Subject: [PATCH 1/4] feat: get_metadatas method --- README.md | 33 ++++++++++++++++++++++++++++++++- examples/get_metadatas.py | 8 ++++++++ fastlabel/__init__.py | 29 +++++++++++++++++++++++++++++ 3 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 examples/get_metadatas.py diff --git a/README.md b/README.md index 4b28588..8110aa7 100644 --- a/README.md +++ b/README.md @@ -23,6 +23,7 @@ - [Common](#common) - [Appendix](#appendix) - [Annotation](#annotation) +- [Metadata](#metadata) - [Project](#project) - [Dataset](#dataset) - [Converter](#converter) @@ -2512,6 +2513,35 @@ Delete an annotation. client.delete_annotation(annotation_id="YOUR_ANNOTATION_ID") ``` +## Metadata + +### Get Metadatas + +Get metadatas. (Up to 1000 metadatas) + +```python +metadatas = client.get_metadatas(project="YOUR_PROJECT_SLUG") +``` + +### Response + +Example of a metadata object + +```python +{ + "id": "YOUR_METADATA_ID", + "key": "YOUR_METADATA_KEY", + "type": "text", + "options": [], + "defaultValue": "", + "order": 1, + "isAdmin": True, + "isRequired": False, + "createdAt": "2021-04-20T03:20:41.427Z", + "updatedAt": "2021-04-20T03:20:41.427Z", +} +``` + ## Project ### Create Project @@ -2622,8 +2652,9 @@ result = client.update_project_user_permission( ``` Available roles: + - `annotator`: Annotator -- `reviewer`: Reviewer +- `reviewer`: Reviewer - `owner`: Project owner - `none`: Remove user from project diff --git a/examples/get_metadatas.py b/examples/get_metadatas.py new file mode 100644 index 0000000..0e6e2dc --- /dev/null +++ b/examples/get_metadatas.py @@ -0,0 +1,8 @@ +from pprint import pprint + +import fastlabel + +client = fastlabel.Client() + +metadatas = client.get_metadatas(project="robotics-task-classification") +pprint(metadatas) diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 990aea0..a9f21d1 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -4017,6 +4017,35 @@ def delete_annotation(self, annotation_id: str) -> None: endpoint = "annotations/" + annotation_id self.api.delete_request(endpoint) + # Metadata + + def get_metadatas( + self, + project: str = None, + offset: int = None, + limit: int = 100, + ) -> list: + """ + Returns a list of metadatas. + Returns up to 1000 at a time, to get more, set offset as the starting position + to fetch. + + project is slug of your project (Required). + offset is the starting position number to fetch (Optional). + limit is the max number to fetch (Optional). + """ + if limit > 1000: + raise FastLabelInvalidException( + "Limit must be less than or equal to 1000.", 422 + ) + endpoint = "metadatas" + params = {"project": project} + if offset: + params["offset"] = offset + if limit: + params["limit"] = limit + return self.api.get_request(endpoint, params=params) + # Project def find_project(self, project_id: str) -> dict: From 7cabf419560c7300a3778e0edb3ba7e2179f74c6 Mon Sep 17 00:00:00 2001 From: kmkkiii Date: Wed, 14 Jan 2026 16:54:06 +0900 Subject: [PATCH 2/4] feat: add support for optional metadata in task creation and updates --- README.md | 84 ++++++++++++++++++++++++++++++++++------ fastlabel/__init__.py | 90 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 162 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 8110aa7..a1e8488 100644 --- a/README.md +++ b/README.md @@ -100,7 +100,7 @@ task_id = client.create_image_task( ) ``` -Create a new task with pre-defined annotations. (Class should be configured on your project in advance) +Create a new task with pre-defined annotations and metadatas. (Class and metadata should be configured on your project in advance) ```python task_id = client.create_image_task( @@ -123,7 +123,13 @@ task_id = client.create_image_task( 200, # bottom-right x 200 # bottom-right y ] - }] + }], + metadatas=[ # (optional) pre-defined metadata key-value pairs + { + "key": "metadata_key", + "value": "metadata_value" + } + ] ) ``` @@ -266,6 +272,12 @@ task_id = client.update_image_task( "startIndex": 2, "endIndex": 0 } + ], + metadatas=[ # (optional) metadata key-value pairs (metadata should be configured on your project in advance) + { + "key": "metadata_key", + "value": "metadata_value" + } ] ) ``` @@ -864,7 +876,7 @@ task_id = client.create_video_task( ) ``` -Create a new task with pre-defined annotations. (Class should be configured on your project in advance) +Create a new task with pre-defined annotations and metadatas. (Class and metadata should be configured on your project in advance) ```python task_id = client.create_video_task( @@ -906,7 +918,13 @@ task_id = client.create_video_task( "autogenerated": False } } - }] + }], + metadatas=[ # (optional) pre-defined metadata key-value pairs + { + "key": "metadata_key", + "value": "metadata_value" + } + ] ) ``` @@ -981,7 +999,13 @@ task_id = client.update_video_task( "autogenerated": False } } - }] + }], + metadatas=[ # (optional) metadata key-value pairs + { + "key": "metadata_key", + "value": "metadata_value" + } + ] ) ``` @@ -1166,7 +1190,7 @@ task_id = client.create_text_task( ) ``` -Create a new task with pre-defined annotations. (Class should be configured on your project in advance) +Create a new task with pre-defined annotations and metadatas. (Class and metadata should be configured on your project in advance) ```python task_id = client.create_text_task( @@ -1180,7 +1204,13 @@ task_id = client.create_text_task( "start": 0, "end": 10, "text": "1234567890" - }] + }], + metadatas=[ # (optional) pre-defined metadata key-value pairs + { + "key": "metadata_key", + "value": "metadata_value" + } + ] ) ``` @@ -1227,7 +1257,13 @@ task_id = client.update_text_task( "start": 0, "end": 10, "text": "0123456789" - }] + }], + metadatas=[ # (optional) metadata key-value pairs + { + "key": "metadata_key", + "value": "metadata_value" + } + ] ) ``` @@ -1354,7 +1390,7 @@ task_id = client.create_audio_task( ) ``` -Create a new task with pre-defined annotations. (Class should be configured on your project in advance) +Create a new task with pre-defined annotations and metadatas. (Class and metadata should be configured on your project in advance) ```python task_id = client.create_audio_task( @@ -1367,7 +1403,13 @@ task_id = client.create_audio_task( "value": "person", "start": 0.4, "end": 0.5 - }] + }], + metadatas=[ # (optional) pre-defined metadata key-value pairs + { + "key": "metadata_key", + "value": "metadata_value" + } + ] ) ``` @@ -1413,7 +1455,13 @@ task_id = client.update_audio_task( "value": "bird", "start": 0.4, "end": 0.5 - }] + }], + metadatas=[ # (optional) metadata key-value pairs + { + "key": "metadata_key", + "value": "metadata_value" + } + ] ) ``` @@ -1590,7 +1638,7 @@ task_id = client.create_pcd_task( ) ``` -Create a new task with pre-defined annotations. (Class should be configured on your project in advance) +Create a new task with pre-defined annotations and metadatas. (Class and metadata should be configured on your project in advance) Annotation Type: cuboid @@ -1617,6 +1665,12 @@ task_id = client.create_pcd_task( ], } ], + metadatas=[ # (optional) pre-defined metadata key-value pairs + { + "key": "metadata_key", + "value": "metadata_value" + } + ] ) ``` @@ -1692,6 +1746,12 @@ task_id = client.update_pcd_task( ], } ], + metadatas=[ # (optional) metadata key-value pairs + { + "key": "metadata_key", + "value": "metadata_value" + } + ] ) ``` diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index a9f21d1..6859111 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -955,6 +955,7 @@ def create_image_task( priority: Priority = None, annotations: list = [], tags: list = [], + metadatas: list = [], is_delete_exif: bool = False, **kwargs, ) -> str: @@ -978,6 +979,8 @@ def create_image_task( 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). + metadatas is a list of metadata key-value pairs to be set in advance (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -1008,6 +1011,8 @@ def create_image_task( payload["annotations"] = delete_extra_annotations_parameter(annotations) if tags: payload["tags"] = tags + if metadatas: + payload["metadatas"] = metadatas if is_delete_exif: payload["isDeleteExif"] = is_delete_exif if custom_task_status: @@ -1026,6 +1031,7 @@ def create_integrated_image_task( external_status: str = None, annotations: list = None, tags: list = None, + metadatas: list = [], **kwargs, ) -> str: """ @@ -1040,6 +1046,8 @@ def create_integrated_image_task( 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). + metadatas is a list of metadata key-value pairs to be set in advance (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -1068,6 +1076,8 @@ def create_integrated_image_task( payload["annotations"] = delete_extra_annotations_parameter(annotations) if tags: payload["tags"] = tags + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -1299,6 +1309,7 @@ def create_sequential_image_task( priority: Priority = None, annotations: list = [], tags: list = [], + metadatas: list = [], is_delete_exif: bool = False, **kwargs, ) -> str: @@ -1322,6 +1333,8 @@ def create_sequential_image_task( 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). + metadatas is a list of metadata key-value pairs to be set in advance (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -1375,6 +1388,8 @@ def create_sequential_image_task( payload["annotations"] = delete_extra_annotations_parameter(annotations) if tags: payload["tags"] = tags + if metadatas: + payload["metadatas"] = metadatas if is_delete_exif: payload["isDeleteExif"] = is_delete_exif @@ -1392,6 +1407,7 @@ def create_video_task( priority: Priority = None, annotations: list = [], tags: list = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -1412,6 +1428,8 @@ def create_video_task( 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). + metadatas is a list of metadata key-value pairs to be set in advance (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -1446,6 +1464,8 @@ def create_video_task( payload["annotations"] = delete_extra_annotations_parameter(annotations) if tags: payload["tags"] = tags + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -1528,6 +1548,7 @@ def create_text_task( priority: Priority = None, annotations: list = [], tags: list = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -1548,6 +1569,8 @@ def create_text_task( 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). + metadatas is a list of metadata key-value pairs to be set in advance (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -1575,6 +1598,8 @@ def create_text_task( payload["annotations"] = delete_extra_annotations_parameter(annotations) if tags: payload["tags"] = tags + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -1650,6 +1675,7 @@ def create_audio_task( priority: Priority = None, annotations: list = [], tags: list = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -1670,6 +1696,8 @@ def create_audio_task( 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). + metadatas is a list of metadata key-value pairs to be set in advance (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -1701,6 +1729,8 @@ def create_audio_task( payload["annotations"] = delete_extra_annotations_parameter(annotations) if tags: payload["tags"] = tags + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -1777,6 +1807,7 @@ def create_dicom_task( status: str = None, external_status: str = None, tags: list = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -1790,6 +1821,8 @@ def create_dicom_task( external_status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). tags is a list of tag to be set in advance (Optional). + metadatas is a list of metadata key-value pairs to be set in advance (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -1810,6 +1843,8 @@ def create_dicom_task( payload["externalStatus"] = external_status if tags: payload["tags"] = tags + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -1833,6 +1868,7 @@ def create_pcd_task( priority: Priority = None, annotations: list = [], tags: list = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -1853,6 +1889,8 @@ def create_pcd_task( 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). + metadatas is a list of metadata key-value pairs to be set in advance (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -1880,6 +1918,8 @@ def create_pcd_task( payload["annotations"] = delete_extra_annotations_parameter(annotations) if tags: payload["tags"] = tags + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -1895,6 +1935,7 @@ def create_sequential_pcd_task( priority: Priority = None, annotations: list = [], tags: list = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -1917,6 +1958,8 @@ def create_sequential_pcd_task( 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). annotations is a list of annotation to be set in advance (Optional). tags is a list of tag to be set in advance (Optional). + metadatas is a list of metadata key-value pairs to be set in advance (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -1970,6 +2013,8 @@ def create_sequential_pcd_task( payload["annotations"] = delete_extra_annotations_parameter(annotations) if tags: payload["tags"] = tags + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -2172,6 +2217,7 @@ def update_task( external_status: str = None, priority: Priority = None, tags: list = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -2189,6 +2235,8 @@ def update_task( high = 30, 'sent_back', 'approved', 'declined', 'customer_declined'. (Optional) tags is a list of tag to be set (Optional). + metadatas is a list of metadata key-value pairs to be set (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -2206,6 +2254,8 @@ def update_task( payload["priority"] = priority if tags: payload["tags"] = tags + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -2221,6 +2271,7 @@ def update_image_task( tags: list = [], annotations: List[dict] = [], relations: Optional[List[dict]] = None, + metadatas: list = [], **kwargs, ) -> str: """ @@ -2242,6 +2293,8 @@ def update_image_task( tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). relations is a list of annotation relations to be set (Optional). + metadatas is a list of metadata key-value pairs to be set (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -2270,6 +2323,8 @@ def update_image_task( payload["relations"] = relations if custom_task_status: payload["customTaskStatus"] = custom_task_status + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -2383,6 +2438,7 @@ def update_sequential_image_task( priority: Priority = None, tags: list = [], annotations: List[dict] = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -2401,6 +2457,8 @@ def update_sequential_image_task( 'sent_back', 'approved', 'declined', 'customer_declined'. (Optional) tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). + metadatas is a list of metadata key-value pairs to be set (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -2420,6 +2478,8 @@ def update_sequential_image_task( payload["tags"] = tags if annotations: payload["annotations"] = delete_extra_annotations_parameter(annotations) + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -2433,6 +2493,7 @@ def update_video_task( priority: Priority = None, tags: list = [], annotations: List[dict] = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -2451,6 +2512,8 @@ def update_video_task( 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). + metadatas is a list of metadata key-value pairs to be set (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -2472,6 +2535,8 @@ def update_video_task( for annotation in annotations: annotation["content"] = "" payload["annotations"] = delete_extra_annotations_parameter(annotations) + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -2535,6 +2600,7 @@ def update_text_task( priority: Priority = None, tags: list = [], annotations: List[dict] = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -2553,6 +2619,8 @@ def update_text_task( 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). + metadatas is a list of metadata key-value pairs to be set (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -2574,6 +2642,8 @@ def update_text_task( for annotation in annotations: annotation["content"] = "" payload["annotations"] = delete_extra_annotations_parameter(annotations) + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -2637,6 +2707,7 @@ def update_audio_task( priority: Priority = None, tags: list = [], annotations: List[dict] = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -2655,6 +2726,8 @@ def update_audio_task( 'sent_back', 'approved', 'declined', 'customer_declined' (Optional). tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). + metadatas is a list of metadata key-value pairs to be set (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -2676,6 +2749,8 @@ def update_audio_task( for annotation in annotations: annotation["content"] = "" payload["annotations"] = delete_extra_annotations_parameter(annotations) + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -2739,6 +2814,7 @@ def update_pcd_task( priority: Priority = None, tags: list = [], annotations: List[dict] = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -2757,6 +2833,8 @@ def update_pcd_task( 'sent_back', 'approved', 'declined', 'customer_declined'. (Optional) tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). + metadatas is a list of metadata key-value pairs to be set (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -2780,6 +2858,8 @@ def update_pcd_task( # the content will be filled on the server side. annotation["content"] = "" payload["annotations"] = delete_extra_annotations_parameter(annotations) + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -2793,6 +2873,7 @@ def update_sequential_pcd_task( priority: Priority = None, tags: list = [], annotations: List[dict] = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -2811,6 +2892,8 @@ def update_sequential_pcd_task( 'sent_back', 'approved', 'declined', 'customer_declined'. (Optional) tags is a list of tag to be set (Optional). annotations is a list of annotation to be set (Optional). + metadatas is a list of metadata key-value pairs to be set (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -2834,6 +2917,8 @@ def update_sequential_pcd_task( # the content will be filled on the server side. annotation["content"] = "" payload["annotations"] = delete_extra_annotations_parameter(annotations) + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) @@ -4072,6 +4157,7 @@ def update_dicom_task( status: str = None, external_status: str = None, tags: list = [], + metadatas: list = [], **kwargs, ) -> str: """ @@ -4083,6 +4169,8 @@ def update_dicom_task( external_status can be 'registered', 'completed', 'skipped', 'reviewed', 'sent_back', 'approved', 'declined', 'customer_declined'. (Optional) tags is a list of tag to be set (Optional). + metadatas is a list of metadata key-value pairs to be set (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -4098,6 +4186,8 @@ def update_dicom_task( payload["externalStatus"] = external_status if tags: payload["tags"] = tags + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) From ce3788299cb65893cb6c29bbec4f69e5d2ec065b Mon Sep 17 00:00:00 2001 From: kmkkiii Date: Fri, 16 Jan 2026 13:04:02 +0900 Subject: [PATCH 3/4] feat: add optional metadata parameter to robotics task creation --- fastlabel/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fastlabel/__init__.py b/fastlabel/__init__.py index 6859111..97daed4 100644 --- a/fastlabel/__init__.py +++ b/fastlabel/__init__.py @@ -2028,6 +2028,7 @@ def create_robotics_task( external_status: Optional[str] = None, priority: Optional[Priority] = None, tags: Optional[list[str]] = None, + metadatas: Optional[list] = None, **kwargs, ) -> str: """ @@ -2044,6 +2045,8 @@ def create_robotics_task( medium = 20, high = 30, tags is a list of tag to be set in advance (Optional). + metadatas is a list of metadata key-value pairs to be set in advance (Optional). + e.g.) [{"key": "metadata_key", "value": "some_value"}] assignee is slug of assigned user (Optional). reviewer is slug of review user (Optional). approver is slug of approve user (Optional). @@ -2062,6 +2065,8 @@ def create_robotics_task( payload["priority"] = priority if tags: payload["tags"] = tags or [] + if metadatas: + payload["metadatas"] = metadatas self.__fill_assign_users(payload, **kwargs) From a947212043952a1e730ad1c34ae46fe31f4761da Mon Sep 17 00:00:00 2001 From: kmkkiii Date: Fri, 16 Jan 2026 15:25:29 +0900 Subject: [PATCH 4/4] chore: update REAMDE.md --- README.md | 60 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index a1e8488..91832bc 100644 --- a/README.md +++ b/README.md @@ -152,10 +152,10 @@ task_id = client.create_integrated_image_task( ) ``` -Create a new task with pre-defined annotations. (Class should be configured on your project in advance) +Create a new task with pre-defined annotations and metadatas. (Class and metadata should be configured on your project in advance) ```python -task_id = client.create_image_task( +task_id = client.create_integrated_image_task( project="YOUR_PROJECT_SLUG", file_path="/sample.jpg", storage_type="gcp", @@ -174,7 +174,13 @@ task_id = client.create_image_task( 200, # bottom-right x 200 # bottom-right y ] - }] + }], + metadatas=[ # (optional) pre-defined metadata key-value pairs + { + "key": "metadata_key", + "value": "some_value" + } + ] ) ``` @@ -748,7 +754,13 @@ task = client.create_sequential_image_task( 100, 100 ]]] # clockwise rotation - }] + }], + metadatas=[ # (optional) pre-defined metadata key-value pairs + { + "key": "metadata_key", + "value": "some_value" + } + ] ) ``` @@ -801,6 +813,12 @@ task_id = client.update_sequential_image_task( ], "points": [990, 560, 980, 550] } + ], + metadatas=[ # (optional) metadata key-value pairs + { + "key": "metadata_key", + "value": "metadata_value" + } ] ) ``` @@ -1877,6 +1895,12 @@ task_id = client.create_sequential_pcd_task( }, }, }, + ], + metadatas=[ # (optional) pre-defined metadata key-value pairs + { + "key": "metadata_key", + "value": "some_value" + } ] ) ``` @@ -1953,6 +1977,12 @@ task_id = client.update_sequential_pcd_task( }, }, }, + ], + metadatas=[ # (optional) metadata key-value pairs + { + "key": "metadata_key", + "value": "metadata_value" + } ] ) ``` @@ -2049,7 +2079,13 @@ Once you receive the status completed, you can get the task. ```python history = client.create_dicom_task( project="YOUR_PROJECT_SLUG", - file_path="./sample.zip" + file_path="./sample.zip", + metadatas=[ # (optional) pre-defined metadata key-value pairs + { + "key": "metadata_key", + "value": "some_value" + } + ] ) ``` @@ -2088,7 +2124,13 @@ task_id = client.update_dicom_task( task_id="YOUR_TASK_ID", status="approved", assignee="USER_SLUG", - tags=["tag1", "tag2"] + tags=["tag1", "tag2"], + metadatas=[ # (optional) metadata key-value pairs + { + "key": "metadata_key", + "value": "metadata_value" + } + ] ) ``` @@ -2140,6 +2182,12 @@ Create a new task (Content creation is required separately). task_id = client.create_robotics_task( project="YOUR_PROJECT_SLUG", name="TASK_NAME", + metadatas=[ # (optional) pre-defined metadata key-value pairs + { + "key": "metadata_key", + "value": "some_value" + } + ] ) ```