Search Filters

class labelbox.schema.search_filters.BaseSearchFilter[source]

Bases: BaseModel

Shared code for all search filters

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.DateRange(*, min: datetime, max: datetime)[source]

Bases: BaseSearchFilter

Date range for a search filter

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'max': FieldInfo(annotation=datetime, required=True, metadata=[PlainSerializer(func=<function format_iso_datetime>, return_type=PydanticUndefined, when_used='always')]), 'min': FieldInfo(annotation=datetime, required=True, metadata=[PlainSerializer(func=<function format_iso_datetime>, return_type=PydanticUndefined, when_used='always')])}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.DateRangeValue(*, operator: RangeOperatorWithValue, value: DateRange)[source]

Bases: BaseSearchFilter

Date range value for a search filter

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operator': FieldInfo(annotation=RangeOperatorWithValue, required=True), 'value': FieldInfo(annotation=DateRange, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.DateValue(*, operator: RangeDateTimeOperatorWithSingleValue, value: datetime)[source]

Bases: BaseSearchFilter

Date value for a search filter

Date formats:

datetime: an existing datetime object str the following formats are accepted: YYYY-MM-DD[T]HH:MM[:SS[.ffffff]][Z or [±]HH[:]MM] NOTE

if a date / datetime string is passed without a timezone, we will assume the time is UTC and convert it to a local timezone so for a string ‘2024-01-01’ that is run on a computer in PST, we would convert it to ‘2024-01-01T08:00:00Z’ while the same string in EST will get converted to ‘2024-01-01T05:00:00Z’

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operator': FieldInfo(annotation=RangeDateTimeOperatorWithSingleValue, required=True), 'value': FieldInfo(annotation=datetime, required=True, metadata=[PlainSerializer(func=<function format_iso_datetime>, return_type=PydanticUndefined, when_used='always')])}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.IdOperator(value)[source]

Bases: Enum

Supported operators for ids like org ids, workspace ids, etc

class labelbox.schema.search_filters.IntegerValue(*, operator: RangeOperatorWithSingleValue, value: int)[source]

Bases: BaseSearchFilter

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operator': FieldInfo(annotation=RangeOperatorWithSingleValue, required=True), 'value': FieldInfo(annotation=int, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.OperationTypeEnum(value)[source]

Bases: Enum

Supported search entity types Each type corresponds to a different filter class

class labelbox.schema.search_filters.OrganizationFilter(*, operation: OperationTypeEnum = OperationTypeEnum.Organization, operator: IdOperator, values: List[str])[source]

Bases: BaseSearchFilter

Filter for organization to which projects belong

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operation': FieldInfo(annotation=OperationTypeEnum, required=False, default=<OperationTypeEnum.Organization: 'organization_id'>, alias_priority=2, serialization_alias='type', metadata=[PlainSerializer(func=<function convert_enum_to_str>, return_type=<class 'str'>, when_used='always')]), 'operator': FieldInfo(annotation=IdOperator, required=True), 'values': FieldInfo(annotation=List[str], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.ProjectStageFilter(*, operation: OperationTypeEnum = OperationTypeEnum.Stage, operator: IdOperator, values: List[LabelingServiceStatus])[source]

Bases: BaseSearchFilter

Filter labelbox service / aka project stages

Stages are: requested, in_progress, completed etc. as described by LabelingServiceStatus

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operation': FieldInfo(annotation=OperationTypeEnum, required=False, default=<OperationTypeEnum.Stage: 'stage'>, alias_priority=2, serialization_alias='type', metadata=[PlainSerializer(func=<function convert_enum_to_str>, return_type=<class 'str'>, when_used='always')]), 'operator': FieldInfo(annotation=IdOperator, required=True), 'values': FieldInfo(annotation=List[labelbox.schema.labeling_service_status.LabelingServiceStatus], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.RangeDateTimeOperatorWithSingleValue(value)[source]

Bases: Enum

Supported operators for dates

class labelbox.schema.search_filters.RangeOperatorWithSingleValue(value)[source]

Bases: Enum

Supported operators for dates

class labelbox.schema.search_filters.RangeOperatorWithValue(value)[source]

Bases: Enum

Supported operators for date ranges

class labelbox.schema.search_filters.SharedWithOrganizationFilter(*, operation: OperationTypeEnum = OperationTypeEnum.SharedWithOrganization, operator: IdOperator, values: List[str])[source]

Bases: BaseSearchFilter

Find project shared with the organization (i.e. not having this organization as a tenantId)

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operation': FieldInfo(annotation=OperationTypeEnum, required=False, default=<OperationTypeEnum.SharedWithOrganization: 'shared_with_organizations'>, alias_priority=2, serialization_alias='type', metadata=[PlainSerializer(func=<function convert_enum_to_str>, return_type=<class 'str'>, when_used='always')]), 'operator': FieldInfo(annotation=IdOperator, required=True), 'values': FieldInfo(annotation=List[str], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.TagFilter(*, operation: OperationTypeEnum = OperationTypeEnum.Tag, operator: IdOperator, values: List[str])[source]

Bases: BaseSearchFilter

Filter for project tags values are tag ids

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operation': FieldInfo(annotation=OperationTypeEnum, required=False, default=<OperationTypeEnum.Tag: 'tag'>, alias_priority=2, serialization_alias='type', metadata=[PlainSerializer(func=<function convert_enum_to_str>, return_type=<class 'str'>, when_used='always')]), 'operator': FieldInfo(annotation=IdOperator, required=True), 'values': FieldInfo(annotation=List[str], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.TaskCompletedCountFilter(*, operation: OperationTypeEnum = OperationTypeEnum.TaskCompletedCount, value: IntegerValue)[source]

Bases: BaseSearchFilter

Filter for completed tasks count

A task maps to a data row. Task completed should map to a data row in a labeling queue DONE

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operation': FieldInfo(annotation=OperationTypeEnum, required=False, default=<OperationTypeEnum.TaskCompletedCount: 'task_completed_count'>, alias_priority=2, serialization_alias='type', metadata=[PlainSerializer(func=<function convert_enum_to_str>, return_type=<class 'str'>, when_used='always')]), 'value': FieldInfo(annotation=IntegerValue, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.TaskRemainingCountFilter(*, operation: OperationTypeEnum = OperationTypeEnum.TaskRemainingCount, value: IntegerValue)[source]

Bases: BaseSearchFilter

Filter for remaining tasks count. Reverse of TaskCompletedCountFilter

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operation': FieldInfo(annotation=OperationTypeEnum, required=False, default=<OperationTypeEnum.TaskRemainingCount: 'task_remaining_count'>, alias_priority=2, serialization_alias='type', metadata=[PlainSerializer(func=<function convert_enum_to_str>, return_type=<class 'str'>, when_used='always')]), 'value': FieldInfo(annotation=IntegerValue, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.WorkforceRequestedDateFilter(*, operation: OperationTypeEnum = OperationTypeEnum.WorforceRequestedDate, value: DateValue)[source]

Bases: BaseSearchFilter

Filter for workforce requested date

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operation': FieldInfo(annotation=OperationTypeEnum, required=False, default=<OperationTypeEnum.WorforceRequestedDate: 'workforce_requested_at'>, alias_priority=2, serialization_alias='type', metadata=[PlainSerializer(func=<function convert_enum_to_str>, return_type=<class 'str'>, when_used='always')]), 'value': FieldInfo(annotation=DateValue, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.WorkforceRequestedDateRangeFilter(*, operation: OperationTypeEnum = OperationTypeEnum.WorforceRequestedDate, value: DateRangeValue)[source]

Bases: BaseSearchFilter

Filter for workforce requested date range

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operation': FieldInfo(annotation=OperationTypeEnum, required=False, default=<OperationTypeEnum.WorforceRequestedDate: 'workforce_requested_at'>, alias_priority=2, serialization_alias='type', metadata=[PlainSerializer(func=<function convert_enum_to_str>, return_type=<class 'str'>, when_used='always')]), 'value': FieldInfo(annotation=DateRangeValue, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.WorkforceStageUpdatedFilter(*, operation: OperationTypeEnum = OperationTypeEnum.WorkforceStageUpdatedDate, value: DateValue)[source]

Bases: BaseSearchFilter

Filter for workforce stage updated date

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operation': FieldInfo(annotation=OperationTypeEnum, required=False, default=<OperationTypeEnum.WorkforceStageUpdatedDate: 'workforce_stage_updated_at'>, alias_priority=2, serialization_alias='type', metadata=[PlainSerializer(func=<function convert_enum_to_str>, return_type=<class 'str'>, when_used='always')]), 'value': FieldInfo(annotation=DateValue, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.WorkforceStageUpdatedRangeFilter(*, operation: OperationTypeEnum = OperationTypeEnum.WorkforceStageUpdatedDate, value: DateRangeValue)[source]

Bases: BaseSearchFilter

Filter for workforce stage updated date range

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operation': FieldInfo(annotation=OperationTypeEnum, required=False, default=<OperationTypeEnum.WorkforceStageUpdatedDate: 'workforce_stage_updated_at'>, alias_priority=2, serialization_alias='type', metadata=[PlainSerializer(func=<function convert_enum_to_str>, return_type=<class 'str'>, when_used='always')]), 'value': FieldInfo(annotation=DateRangeValue, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class labelbox.schema.search_filters.WorkspaceFilter(*, operation: OperationTypeEnum = OperationTypeEnum.Workspace, operator: IdOperator, values: List[str])[source]

Bases: BaseSearchFilter

Filter for workspace

model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'use_enum_values': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'operation': FieldInfo(annotation=OperationTypeEnum, required=False, default=<OperationTypeEnum.Workspace: 'workspace'>, alias_priority=2, serialization_alias='type', metadata=[PlainSerializer(func=<function convert_enum_to_str>, return_type=<class 'str'>, when_used='always')]), 'operator': FieldInfo(annotation=IdOperator, required=True), 'values': FieldInfo(annotation=List[str], required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

labelbox.schema.search_filters.build_search_filter(filter: List[OrganizationFilter | WorkspaceFilter | SharedWithOrganizationFilter | TagFilter | ProjectStageFilter | WorkforceRequestedDateFilter | WorkforceStageUpdatedFilter | WorkforceRequestedDateRangeFilter | WorkforceStageUpdatedRangeFilter | TaskCompletedCountFilter | TaskRemainingCountFilter])[source]

Converts a list of search filters to a graphql string