You've already forked DataMate
- Updated `update_file_tags` to support both simplified and full tag formats. - Introduced `TagFormatConverter` to handle conversion from simplified external tags to internal storage format. - Added logic to fetch and utilize the appropriate annotation template for conversion. - Improved error handling for missing templates and unknown controls during tag updates. - Created example script demonstrating the usage of the new tag format conversion feature. - Added unit tests for `TagFormatConverter` to ensure correct functionality and edge case handling.
54 lines
1.2 KiB
Python
54 lines
1.2 KiB
Python
from .config import (
|
|
ConfigResponse,
|
|
TagConfigResponse
|
|
)
|
|
|
|
from .sync import (
|
|
SyncDatasetRequest,
|
|
SyncDatasetResponse,
|
|
SyncAnnotationsRequest,
|
|
SyncAnnotationsResponse,
|
|
)
|
|
|
|
from .tag import (
|
|
UpdateFileTagsRequest,
|
|
UpdateFileTagsResponse,
|
|
)
|
|
|
|
from .template import (
|
|
CreateAnnotationTemplateRequest,
|
|
UpdateAnnotationTemplateRequest,
|
|
AnnotationTemplateResponse,
|
|
AnnotationTemplateListResponse
|
|
)
|
|
|
|
from .mapping import (
|
|
DatasetMappingCreateRequest,
|
|
DatasetMappingCreateResponse,
|
|
DatasetMappingUpdateRequest,
|
|
DatasetMappingResponse,
|
|
DeleteDatasetResponse,
|
|
)
|
|
|
|
# Rebuild model to resolve forward references
|
|
DatasetMappingResponse.model_rebuild()
|
|
|
|
__all__ = [
|
|
"ConfigResponse",
|
|
"TagConfigResponse",
|
|
"DatasetMappingCreateRequest",
|
|
"DatasetMappingCreateResponse",
|
|
"DatasetMappingUpdateRequest",
|
|
"DatasetMappingResponse",
|
|
"SyncDatasetRequest",
|
|
"SyncDatasetResponse",
|
|
"SyncAnnotationsRequest",
|
|
"SyncAnnotationsResponse",
|
|
"DeleteDatasetResponse",
|
|
"UpdateFileTagsRequest",
|
|
"UpdateFileTagsResponse",
|
|
"CreateAnnotationTemplateRequest",
|
|
"UpdateAnnotationTemplateRequest",
|
|
"AnnotationTemplateResponse",
|
|
"AnnotationTemplateListResponse",
|
|
] |