rapidata 1.4.6__py3-none-any.whl → 1.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of rapidata might be problematic. Click here for more details.
- rapidata/api_client/__init__.py +3 -2
- rapidata/api_client/api/validation_api.py +270 -6
- rapidata/api_client/models/__init__.py +3 -2
- rapidata/api_client/models/get_validation_set_by_id_result.py +94 -0
- rapidata/api_client/models/rapid_answer.py +5 -3
- rapidata/api_client/models/validation_set_model.py +96 -0
- rapidata/api_client/models/validation_set_model_paged_result.py +105 -0
- rapidata/api_client_README.md +4 -2
- rapidata/rapidata_client/dataset/rapidata_validation_set.py +5 -4
- rapidata/rapidata_client/dataset/validation_set_builder.py +1 -0
- rapidata/rapidata_client/rapidata_client.py +35 -11
- rapidata/service/openapi_service.py +30 -3
- {rapidata-1.4.6.dist-info → rapidata-1.5.0.dist-info}/METADATA +1 -1
- {rapidata-1.4.6.dist-info → rapidata-1.5.0.dist-info}/RECORD +16 -13
- {rapidata-1.4.6.dist-info → rapidata-1.5.0.dist-info}/LICENSE +0 -0
- {rapidata-1.4.6.dist-info → rapidata-1.5.0.dist-info}/WHEEL +0 -0
rapidata/api_client/__init__.py
CHANGED
|
@@ -160,6 +160,7 @@ from rapidata.api_client.models.get_pipeline_by_id_result import GetPipelineById
|
|
|
160
160
|
from rapidata.api_client.models.get_pipeline_by_id_result_artifacts_value import GetPipelineByIdResultArtifactsValue
|
|
161
161
|
from rapidata.api_client.models.get_public_orders_result import GetPublicOrdersResult
|
|
162
162
|
from rapidata.api_client.models.get_simple_workflow_result_overview_result import GetSimpleWorkflowResultOverviewResult
|
|
163
|
+
from rapidata.api_client.models.get_validation_set_by_id_result import GetValidationSetByIdResult
|
|
163
164
|
from rapidata.api_client.models.get_workflow_by_id_result import GetWorkflowByIdResult
|
|
164
165
|
from rapidata.api_client.models.get_workflow_by_id_result_workflow import GetWorkflowByIdResultWorkflow
|
|
165
166
|
from rapidata.api_client.models.get_workflow_progress_result import GetWorkflowProgressResult
|
|
@@ -285,9 +286,9 @@ from rapidata.api_client.models.user_score_user_filter_model import UserScoreUse
|
|
|
285
286
|
from rapidata.api_client.models.validation_chance import ValidationChance
|
|
286
287
|
from rapidata.api_client.models.validation_import_post_request_blueprint import ValidationImportPostRequestBlueprint
|
|
287
288
|
from rapidata.api_client.models.validation_selection import ValidationSelection
|
|
288
|
-
from rapidata.api_client.models.
|
|
289
|
+
from rapidata.api_client.models.validation_set_model import ValidationSetModel
|
|
290
|
+
from rapidata.api_client.models.validation_set_model_paged_result import ValidationSetModelPagedResult
|
|
289
291
|
from rapidata.api_client.models.validation_set_overview_model import ValidationSetOverviewModel
|
|
290
|
-
from rapidata.api_client.models.validation_set_paged_result import ValidationSetPagedResult
|
|
291
292
|
from rapidata.api_client.models.workflow_aggregation_step_model import WorkflowAggregationStepModel
|
|
292
293
|
from rapidata.api_client.models.workflow_artifact_model import WorkflowArtifactModel
|
|
293
294
|
from rapidata.api_client.models.workflow_config_artifact_model import WorkflowConfigArtifactModel
|
|
@@ -24,10 +24,11 @@ from rapidata.api_client.models.add_validation_rapid_result import AddValidation
|
|
|
24
24
|
from rapidata.api_client.models.add_validation_text_rapid_model import AddValidationTextRapidModel
|
|
25
25
|
from rapidata.api_client.models.create_empty_validation_set_result import CreateEmptyValidationSetResult
|
|
26
26
|
from rapidata.api_client.models.get_available_validation_sets_result import GetAvailableValidationSetsResult
|
|
27
|
+
from rapidata.api_client.models.get_validation_set_by_id_result import GetValidationSetByIdResult
|
|
27
28
|
from rapidata.api_client.models.import_validation_set_from_file_result import ImportValidationSetFromFileResult
|
|
28
29
|
from rapidata.api_client.models.query_validation_set_model import QueryValidationSetModel
|
|
29
30
|
from rapidata.api_client.models.validation_import_post_request_blueprint import ValidationImportPostRequestBlueprint
|
|
30
|
-
from rapidata.api_client.models.
|
|
31
|
+
from rapidata.api_client.models.validation_set_model_paged_result import ValidationSetModelPagedResult
|
|
31
32
|
|
|
32
33
|
from rapidata.api_client.api_client import ApiClient, RequestSerialized
|
|
33
34
|
from rapidata.api_client.api_response import ApiResponse
|
|
@@ -1122,6 +1123,269 @@ class ValidationApi:
|
|
|
1122
1123
|
|
|
1123
1124
|
|
|
1124
1125
|
|
|
1126
|
+
@validate_call
|
|
1127
|
+
def validation_get_by_id_get(
|
|
1128
|
+
self,
|
|
1129
|
+
id: Annotated[Optional[StrictStr], Field(description="The id of the validation set to get.")] = None,
|
|
1130
|
+
_request_timeout: Union[
|
|
1131
|
+
None,
|
|
1132
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1133
|
+
Tuple[
|
|
1134
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1135
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1136
|
+
]
|
|
1137
|
+
] = None,
|
|
1138
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1139
|
+
_content_type: Optional[StrictStr] = None,
|
|
1140
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1141
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1142
|
+
) -> GetValidationSetByIdResult:
|
|
1143
|
+
"""Gets a validation set by the id.
|
|
1144
|
+
|
|
1145
|
+
|
|
1146
|
+
:param id: The id of the validation set to get.
|
|
1147
|
+
:type id: str
|
|
1148
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1149
|
+
number provided, it will be total request
|
|
1150
|
+
timeout. It can also be a pair (tuple) of
|
|
1151
|
+
(connection, read) timeouts.
|
|
1152
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1153
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1154
|
+
request; this effectively ignores the
|
|
1155
|
+
authentication in the spec for a single request.
|
|
1156
|
+
:type _request_auth: dict, optional
|
|
1157
|
+
:param _content_type: force content-type for the request.
|
|
1158
|
+
:type _content_type: str, Optional
|
|
1159
|
+
:param _headers: set to override the headers for a single
|
|
1160
|
+
request; this effectively ignores the headers
|
|
1161
|
+
in the spec for a single request.
|
|
1162
|
+
:type _headers: dict, optional
|
|
1163
|
+
:param _host_index: set to override the host_index for a single
|
|
1164
|
+
request; this effectively ignores the host_index
|
|
1165
|
+
in the spec for a single request.
|
|
1166
|
+
:type _host_index: int, optional
|
|
1167
|
+
:return: Returns the result object.
|
|
1168
|
+
""" # noqa: E501
|
|
1169
|
+
|
|
1170
|
+
_param = self._validation_get_by_id_get_serialize(
|
|
1171
|
+
id=id,
|
|
1172
|
+
_request_auth=_request_auth,
|
|
1173
|
+
_content_type=_content_type,
|
|
1174
|
+
_headers=_headers,
|
|
1175
|
+
_host_index=_host_index
|
|
1176
|
+
)
|
|
1177
|
+
|
|
1178
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1179
|
+
'200': "GetValidationSetByIdResult",
|
|
1180
|
+
}
|
|
1181
|
+
response_data = self.api_client.call_api(
|
|
1182
|
+
*_param,
|
|
1183
|
+
_request_timeout=_request_timeout
|
|
1184
|
+
)
|
|
1185
|
+
response_data.read()
|
|
1186
|
+
return self.api_client.response_deserialize(
|
|
1187
|
+
response_data=response_data,
|
|
1188
|
+
response_types_map=_response_types_map,
|
|
1189
|
+
).data
|
|
1190
|
+
|
|
1191
|
+
|
|
1192
|
+
@validate_call
|
|
1193
|
+
def validation_get_by_id_get_with_http_info(
|
|
1194
|
+
self,
|
|
1195
|
+
id: Annotated[Optional[StrictStr], Field(description="The id of the validation set to get.")] = None,
|
|
1196
|
+
_request_timeout: Union[
|
|
1197
|
+
None,
|
|
1198
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1199
|
+
Tuple[
|
|
1200
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1201
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1202
|
+
]
|
|
1203
|
+
] = None,
|
|
1204
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1205
|
+
_content_type: Optional[StrictStr] = None,
|
|
1206
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1207
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1208
|
+
) -> ApiResponse[GetValidationSetByIdResult]:
|
|
1209
|
+
"""Gets a validation set by the id.
|
|
1210
|
+
|
|
1211
|
+
|
|
1212
|
+
:param id: The id of the validation set to get.
|
|
1213
|
+
:type id: str
|
|
1214
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1215
|
+
number provided, it will be total request
|
|
1216
|
+
timeout. It can also be a pair (tuple) of
|
|
1217
|
+
(connection, read) timeouts.
|
|
1218
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1219
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1220
|
+
request; this effectively ignores the
|
|
1221
|
+
authentication in the spec for a single request.
|
|
1222
|
+
:type _request_auth: dict, optional
|
|
1223
|
+
:param _content_type: force content-type for the request.
|
|
1224
|
+
:type _content_type: str, Optional
|
|
1225
|
+
:param _headers: set to override the headers for a single
|
|
1226
|
+
request; this effectively ignores the headers
|
|
1227
|
+
in the spec for a single request.
|
|
1228
|
+
:type _headers: dict, optional
|
|
1229
|
+
:param _host_index: set to override the host_index for a single
|
|
1230
|
+
request; this effectively ignores the host_index
|
|
1231
|
+
in the spec for a single request.
|
|
1232
|
+
:type _host_index: int, optional
|
|
1233
|
+
:return: Returns the result object.
|
|
1234
|
+
""" # noqa: E501
|
|
1235
|
+
|
|
1236
|
+
_param = self._validation_get_by_id_get_serialize(
|
|
1237
|
+
id=id,
|
|
1238
|
+
_request_auth=_request_auth,
|
|
1239
|
+
_content_type=_content_type,
|
|
1240
|
+
_headers=_headers,
|
|
1241
|
+
_host_index=_host_index
|
|
1242
|
+
)
|
|
1243
|
+
|
|
1244
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1245
|
+
'200': "GetValidationSetByIdResult",
|
|
1246
|
+
}
|
|
1247
|
+
response_data = self.api_client.call_api(
|
|
1248
|
+
*_param,
|
|
1249
|
+
_request_timeout=_request_timeout
|
|
1250
|
+
)
|
|
1251
|
+
response_data.read()
|
|
1252
|
+
return self.api_client.response_deserialize(
|
|
1253
|
+
response_data=response_data,
|
|
1254
|
+
response_types_map=_response_types_map,
|
|
1255
|
+
)
|
|
1256
|
+
|
|
1257
|
+
|
|
1258
|
+
@validate_call
|
|
1259
|
+
def validation_get_by_id_get_without_preload_content(
|
|
1260
|
+
self,
|
|
1261
|
+
id: Annotated[Optional[StrictStr], Field(description="The id of the validation set to get.")] = None,
|
|
1262
|
+
_request_timeout: Union[
|
|
1263
|
+
None,
|
|
1264
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1265
|
+
Tuple[
|
|
1266
|
+
Annotated[StrictFloat, Field(gt=0)],
|
|
1267
|
+
Annotated[StrictFloat, Field(gt=0)]
|
|
1268
|
+
]
|
|
1269
|
+
] = None,
|
|
1270
|
+
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
|
1271
|
+
_content_type: Optional[StrictStr] = None,
|
|
1272
|
+
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1273
|
+
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1274
|
+
) -> RESTResponseType:
|
|
1275
|
+
"""Gets a validation set by the id.
|
|
1276
|
+
|
|
1277
|
+
|
|
1278
|
+
:param id: The id of the validation set to get.
|
|
1279
|
+
:type id: str
|
|
1280
|
+
:param _request_timeout: timeout setting for this request. If one
|
|
1281
|
+
number provided, it will be total request
|
|
1282
|
+
timeout. It can also be a pair (tuple) of
|
|
1283
|
+
(connection, read) timeouts.
|
|
1284
|
+
:type _request_timeout: int, tuple(int, int), optional
|
|
1285
|
+
:param _request_auth: set to override the auth_settings for an a single
|
|
1286
|
+
request; this effectively ignores the
|
|
1287
|
+
authentication in the spec for a single request.
|
|
1288
|
+
:type _request_auth: dict, optional
|
|
1289
|
+
:param _content_type: force content-type for the request.
|
|
1290
|
+
:type _content_type: str, Optional
|
|
1291
|
+
:param _headers: set to override the headers for a single
|
|
1292
|
+
request; this effectively ignores the headers
|
|
1293
|
+
in the spec for a single request.
|
|
1294
|
+
:type _headers: dict, optional
|
|
1295
|
+
:param _host_index: set to override the host_index for a single
|
|
1296
|
+
request; this effectively ignores the host_index
|
|
1297
|
+
in the spec for a single request.
|
|
1298
|
+
:type _host_index: int, optional
|
|
1299
|
+
:return: Returns the result object.
|
|
1300
|
+
""" # noqa: E501
|
|
1301
|
+
|
|
1302
|
+
_param = self._validation_get_by_id_get_serialize(
|
|
1303
|
+
id=id,
|
|
1304
|
+
_request_auth=_request_auth,
|
|
1305
|
+
_content_type=_content_type,
|
|
1306
|
+
_headers=_headers,
|
|
1307
|
+
_host_index=_host_index
|
|
1308
|
+
)
|
|
1309
|
+
|
|
1310
|
+
_response_types_map: Dict[str, Optional[str]] = {
|
|
1311
|
+
'200': "GetValidationSetByIdResult",
|
|
1312
|
+
}
|
|
1313
|
+
response_data = self.api_client.call_api(
|
|
1314
|
+
*_param,
|
|
1315
|
+
_request_timeout=_request_timeout
|
|
1316
|
+
)
|
|
1317
|
+
return response_data.response
|
|
1318
|
+
|
|
1319
|
+
|
|
1320
|
+
def _validation_get_by_id_get_serialize(
|
|
1321
|
+
self,
|
|
1322
|
+
id,
|
|
1323
|
+
_request_auth,
|
|
1324
|
+
_content_type,
|
|
1325
|
+
_headers,
|
|
1326
|
+
_host_index,
|
|
1327
|
+
) -> RequestSerialized:
|
|
1328
|
+
|
|
1329
|
+
_host = None
|
|
1330
|
+
|
|
1331
|
+
_collection_formats: Dict[str, str] = {
|
|
1332
|
+
}
|
|
1333
|
+
|
|
1334
|
+
_path_params: Dict[str, str] = {}
|
|
1335
|
+
_query_params: List[Tuple[str, str]] = []
|
|
1336
|
+
_header_params: Dict[str, Optional[str]] = _headers or {}
|
|
1337
|
+
_form_params: List[Tuple[str, str]] = []
|
|
1338
|
+
_files: Dict[
|
|
1339
|
+
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
|
1340
|
+
] = {}
|
|
1341
|
+
_body_params: Optional[bytes] = None
|
|
1342
|
+
|
|
1343
|
+
# process the path parameters
|
|
1344
|
+
# process the query parameters
|
|
1345
|
+
if id is not None:
|
|
1346
|
+
|
|
1347
|
+
_query_params.append(('id', id))
|
|
1348
|
+
|
|
1349
|
+
# process the header parameters
|
|
1350
|
+
# process the form parameters
|
|
1351
|
+
# process the body parameter
|
|
1352
|
+
|
|
1353
|
+
|
|
1354
|
+
# set the HTTP header `Accept`
|
|
1355
|
+
if 'Accept' not in _header_params:
|
|
1356
|
+
_header_params['Accept'] = self.api_client.select_header_accept(
|
|
1357
|
+
[
|
|
1358
|
+
'text/plain',
|
|
1359
|
+
'application/json',
|
|
1360
|
+
'text/json'
|
|
1361
|
+
]
|
|
1362
|
+
)
|
|
1363
|
+
|
|
1364
|
+
|
|
1365
|
+
# authentication setting
|
|
1366
|
+
_auth_settings: List[str] = [
|
|
1367
|
+
'bearer',
|
|
1368
|
+
'oauth2'
|
|
1369
|
+
]
|
|
1370
|
+
|
|
1371
|
+
return self.api_client.param_serialize(
|
|
1372
|
+
method='GET',
|
|
1373
|
+
resource_path='/Validation/GetById',
|
|
1374
|
+
path_params=_path_params,
|
|
1375
|
+
query_params=_query_params,
|
|
1376
|
+
header_params=_header_params,
|
|
1377
|
+
body=_body_params,
|
|
1378
|
+
post_params=_form_params,
|
|
1379
|
+
files=_files,
|
|
1380
|
+
auth_settings=_auth_settings,
|
|
1381
|
+
collection_formats=_collection_formats,
|
|
1382
|
+
_host=_host,
|
|
1383
|
+
_request_auth=_request_auth
|
|
1384
|
+
)
|
|
1385
|
+
|
|
1386
|
+
|
|
1387
|
+
|
|
1388
|
+
|
|
1125
1389
|
@validate_call
|
|
1126
1390
|
def validation_import_compare_post(
|
|
1127
1391
|
self,
|
|
@@ -1716,7 +1980,7 @@ class ValidationApi:
|
|
|
1716
1980
|
_content_type: Optional[StrictStr] = None,
|
|
1717
1981
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1718
1982
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1719
|
-
) ->
|
|
1983
|
+
) -> ValidationSetModelPagedResult:
|
|
1720
1984
|
"""Queries validation sets based on the provided filter, paging and sorting criteria.
|
|
1721
1985
|
|
|
1722
1986
|
|
|
@@ -1753,7 +2017,7 @@ class ValidationApi:
|
|
|
1753
2017
|
)
|
|
1754
2018
|
|
|
1755
2019
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
1756
|
-
'200': "
|
|
2020
|
+
'200': "ValidationSetModelPagedResult",
|
|
1757
2021
|
}
|
|
1758
2022
|
response_data = self.api_client.call_api(
|
|
1759
2023
|
*_param,
|
|
@@ -1782,7 +2046,7 @@ class ValidationApi:
|
|
|
1782
2046
|
_content_type: Optional[StrictStr] = None,
|
|
1783
2047
|
_headers: Optional[Dict[StrictStr, Any]] = None,
|
|
1784
2048
|
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
|
1785
|
-
) -> ApiResponse[
|
|
2049
|
+
) -> ApiResponse[ValidationSetModelPagedResult]:
|
|
1786
2050
|
"""Queries validation sets based on the provided filter, paging and sorting criteria.
|
|
1787
2051
|
|
|
1788
2052
|
|
|
@@ -1819,7 +2083,7 @@ class ValidationApi:
|
|
|
1819
2083
|
)
|
|
1820
2084
|
|
|
1821
2085
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
1822
|
-
'200': "
|
|
2086
|
+
'200': "ValidationSetModelPagedResult",
|
|
1823
2087
|
}
|
|
1824
2088
|
response_data = self.api_client.call_api(
|
|
1825
2089
|
*_param,
|
|
@@ -1885,7 +2149,7 @@ class ValidationApi:
|
|
|
1885
2149
|
)
|
|
1886
2150
|
|
|
1887
2151
|
_response_types_map: Dict[str, Optional[str]] = {
|
|
1888
|
-
'200': "
|
|
2152
|
+
'200': "ValidationSetModelPagedResult",
|
|
1889
2153
|
}
|
|
1890
2154
|
response_data = self.api_client.call_api(
|
|
1891
2155
|
*_param,
|
|
@@ -129,6 +129,7 @@ from rapidata.api_client.models.get_pipeline_by_id_result import GetPipelineById
|
|
|
129
129
|
from rapidata.api_client.models.get_pipeline_by_id_result_artifacts_value import GetPipelineByIdResultArtifactsValue
|
|
130
130
|
from rapidata.api_client.models.get_public_orders_result import GetPublicOrdersResult
|
|
131
131
|
from rapidata.api_client.models.get_simple_workflow_result_overview_result import GetSimpleWorkflowResultOverviewResult
|
|
132
|
+
from rapidata.api_client.models.get_validation_set_by_id_result import GetValidationSetByIdResult
|
|
132
133
|
from rapidata.api_client.models.get_workflow_by_id_result import GetWorkflowByIdResult
|
|
133
134
|
from rapidata.api_client.models.get_workflow_by_id_result_workflow import GetWorkflowByIdResultWorkflow
|
|
134
135
|
from rapidata.api_client.models.get_workflow_progress_result import GetWorkflowProgressResult
|
|
@@ -254,9 +255,9 @@ from rapidata.api_client.models.user_score_user_filter_model import UserScoreUse
|
|
|
254
255
|
from rapidata.api_client.models.validation_chance import ValidationChance
|
|
255
256
|
from rapidata.api_client.models.validation_import_post_request_blueprint import ValidationImportPostRequestBlueprint
|
|
256
257
|
from rapidata.api_client.models.validation_selection import ValidationSelection
|
|
257
|
-
from rapidata.api_client.models.
|
|
258
|
+
from rapidata.api_client.models.validation_set_model import ValidationSetModel
|
|
259
|
+
from rapidata.api_client.models.validation_set_model_paged_result import ValidationSetModelPagedResult
|
|
258
260
|
from rapidata.api_client.models.validation_set_overview_model import ValidationSetOverviewModel
|
|
259
|
-
from rapidata.api_client.models.validation_set_paged_result import ValidationSetPagedResult
|
|
260
261
|
from rapidata.api_client.models.workflow_aggregation_step_model import WorkflowAggregationStepModel
|
|
261
262
|
from rapidata.api_client.models.workflow_artifact_model import WorkflowArtifactModel
|
|
262
263
|
from rapidata.api_client.models.workflow_config_artifact_model import WorkflowConfigArtifactModel
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class GetValidationSetByIdResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
GetValidationSetByIdResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
id: StrictStr
|
|
31
|
+
name: StrictStr
|
|
32
|
+
owner_mail: StrictStr = Field(alias="ownerMail")
|
|
33
|
+
created_at: datetime = Field(alias="createdAt")
|
|
34
|
+
__properties: ClassVar[List[str]] = ["id", "name", "ownerMail", "createdAt"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of GetValidationSetByIdResult from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of GetValidationSetByIdResult from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"id": obj.get("id"),
|
|
88
|
+
"name": obj.get("name"),
|
|
89
|
+
"ownerMail": obj.get("ownerMail"),
|
|
90
|
+
"createdAt": obj.get("createdAt")
|
|
91
|
+
})
|
|
92
|
+
return _obj
|
|
93
|
+
|
|
94
|
+
|
|
@@ -17,8 +17,8 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
21
|
-
from typing import Any, ClassVar, Dict, List
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Union
|
|
22
22
|
from rapidata.api_client.models.rapid_answer_result import RapidAnswerResult
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
@@ -30,8 +30,9 @@ class RapidAnswer(BaseModel):
|
|
|
30
30
|
id: StrictStr
|
|
31
31
|
country: StrictStr
|
|
32
32
|
result: RapidAnswerResult
|
|
33
|
+
user_score: Union[StrictFloat, StrictInt] = Field(alias="userScore")
|
|
33
34
|
demographic_information: Dict[str, StrictStr] = Field(alias="demographicInformation")
|
|
34
|
-
__properties: ClassVar[List[str]] = ["id", "country", "result", "demographicInformation"]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["id", "country", "result", "userScore", "demographicInformation"]
|
|
35
36
|
|
|
36
37
|
model_config = ConfigDict(
|
|
37
38
|
populate_by_name=True,
|
|
@@ -90,6 +91,7 @@ class RapidAnswer(BaseModel):
|
|
|
90
91
|
"id": obj.get("id"),
|
|
91
92
|
"country": obj.get("country"),
|
|
92
93
|
"result": RapidAnswerResult.from_dict(obj["result"]) if obj.get("result") is not None else None,
|
|
94
|
+
"userScore": obj.get("userScore"),
|
|
93
95
|
"demographicInformation": obj.get("demographicInformation")
|
|
94
96
|
})
|
|
95
97
|
return _obj
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ValidationSetModel(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ValidationSetModel
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
id: StrictStr
|
|
31
|
+
name: StrictStr
|
|
32
|
+
owner_id: StrictStr = Field(alias="ownerId")
|
|
33
|
+
owner_mail: StrictStr = Field(alias="ownerMail")
|
|
34
|
+
created_at: datetime = Field(alias="createdAt")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["id", "name", "ownerId", "ownerMail", "createdAt"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of ValidationSetModel from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
"""
|
|
68
|
+
excluded_fields: Set[str] = set([
|
|
69
|
+
])
|
|
70
|
+
|
|
71
|
+
_dict = self.model_dump(
|
|
72
|
+
by_alias=True,
|
|
73
|
+
exclude=excluded_fields,
|
|
74
|
+
exclude_none=True,
|
|
75
|
+
)
|
|
76
|
+
return _dict
|
|
77
|
+
|
|
78
|
+
@classmethod
|
|
79
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
80
|
+
"""Create an instance of ValidationSetModel from a dict"""
|
|
81
|
+
if obj is None:
|
|
82
|
+
return None
|
|
83
|
+
|
|
84
|
+
if not isinstance(obj, dict):
|
|
85
|
+
return cls.model_validate(obj)
|
|
86
|
+
|
|
87
|
+
_obj = cls.model_validate({
|
|
88
|
+
"id": obj.get("id"),
|
|
89
|
+
"name": obj.get("name"),
|
|
90
|
+
"ownerId": obj.get("ownerId"),
|
|
91
|
+
"ownerMail": obj.get("ownerMail"),
|
|
92
|
+
"createdAt": obj.get("createdAt")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Rapidata.Dataset
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: v1
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
22
|
+
from rapidata.api_client.models.validation_set_model import ValidationSetModel
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class ValidationSetModelPagedResult(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
ValidationSetModelPagedResult
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
total: StrictInt
|
|
31
|
+
page: StrictInt
|
|
32
|
+
page_size: StrictInt = Field(alias="pageSize")
|
|
33
|
+
items: List[ValidationSetModel]
|
|
34
|
+
total_pages: Optional[StrictInt] = Field(default=None, alias="totalPages")
|
|
35
|
+
__properties: ClassVar[List[str]] = ["total", "page", "pageSize", "items", "totalPages"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
populate_by_name=True,
|
|
39
|
+
validate_assignment=True,
|
|
40
|
+
protected_namespaces=(),
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
def to_str(self) -> str:
|
|
45
|
+
"""Returns the string representation of the model using alias"""
|
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
+
|
|
48
|
+
def to_json(self) -> str:
|
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
+
return json.dumps(self.to_dict())
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of ValidationSetModelPagedResult from a JSON string"""
|
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
|
57
|
+
|
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
|
60
|
+
|
|
61
|
+
This has the following differences from calling pydantic's
|
|
62
|
+
`self.model_dump(by_alias=True)`:
|
|
63
|
+
|
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
|
65
|
+
were set at model initialization. Other fields with value `None`
|
|
66
|
+
are ignored.
|
|
67
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
70
|
+
"total_pages",
|
|
71
|
+
])
|
|
72
|
+
|
|
73
|
+
_dict = self.model_dump(
|
|
74
|
+
by_alias=True,
|
|
75
|
+
exclude=excluded_fields,
|
|
76
|
+
exclude_none=True,
|
|
77
|
+
)
|
|
78
|
+
# override the default output from pydantic by calling `to_dict()` of each item in items (list)
|
|
79
|
+
_items = []
|
|
80
|
+
if self.items:
|
|
81
|
+
for _item_items in self.items:
|
|
82
|
+
if _item_items:
|
|
83
|
+
_items.append(_item_items.to_dict())
|
|
84
|
+
_dict['items'] = _items
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of ValidationSetModelPagedResult from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"total": obj.get("total"),
|
|
98
|
+
"page": obj.get("page"),
|
|
99
|
+
"pageSize": obj.get("pageSize"),
|
|
100
|
+
"items": [ValidationSetModel.from_dict(_item) for _item in obj["items"]] if obj.get("items") is not None else None,
|
|
101
|
+
"totalPages": obj.get("totalPages")
|
|
102
|
+
})
|
|
103
|
+
return _obj
|
|
104
|
+
|
|
105
|
+
|
rapidata/api_client_README.md
CHANGED
|
@@ -128,6 +128,7 @@ Class | Method | HTTP request | Description
|
|
|
128
128
|
*ValidationApi* | [**validation_add_validation_text_rapid_post**](rapidata/api_client/docs/ValidationApi.md#validation_add_validation_text_rapid_post) | **POST** /Validation/AddValidationTextRapid | Adds a new validation rapid to the specified validation set.
|
|
129
129
|
*ValidationApi* | [**validation_create_validation_set_post**](rapidata/api_client/docs/ValidationApi.md#validation_create_validation_set_post) | **POST** /Validation/CreateValidationSet | Creates a new empty validation set.
|
|
130
130
|
*ValidationApi* | [**validation_get_available_validation_sets_get**](rapidata/api_client/docs/ValidationApi.md#validation_get_available_validation_sets_get) | **GET** /Validation/GetAvailableValidationSets | Gets the available validation sets for the current user.
|
|
131
|
+
*ValidationApi* | [**validation_get_by_id_get**](rapidata/api_client/docs/ValidationApi.md#validation_get_by_id_get) | **GET** /Validation/GetById | Gets a validation set by the id.
|
|
131
132
|
*ValidationApi* | [**validation_import_compare_post**](rapidata/api_client/docs/ValidationApi.md#validation_import_compare_post) | **POST** /Validation/ImportCompare | Imports a compare validation set from a zip file.
|
|
132
133
|
*ValidationApi* | [**validation_import_post**](rapidata/api_client/docs/ValidationApi.md#validation_import_post) | **POST** /Validation/Import | Imports a validation set from a zip file.
|
|
133
134
|
*ValidationApi* | [**validation_query_validation_sets_get**](rapidata/api_client/docs/ValidationApi.md#validation_query_validation_sets_get) | **GET** /Validation/QueryValidationSets | Queries validation sets based on the provided filter, paging and sorting criteria.
|
|
@@ -255,6 +256,7 @@ Class | Method | HTTP request | Description
|
|
|
255
256
|
- [GetPipelineByIdResultArtifactsValue](rapidata/api_client/docs/GetPipelineByIdResultArtifactsValue.md)
|
|
256
257
|
- [GetPublicOrdersResult](rapidata/api_client/docs/GetPublicOrdersResult.md)
|
|
257
258
|
- [GetSimpleWorkflowResultOverviewResult](rapidata/api_client/docs/GetSimpleWorkflowResultOverviewResult.md)
|
|
259
|
+
- [GetValidationSetByIdResult](rapidata/api_client/docs/GetValidationSetByIdResult.md)
|
|
258
260
|
- [GetWorkflowByIdResult](rapidata/api_client/docs/GetWorkflowByIdResult.md)
|
|
259
261
|
- [GetWorkflowByIdResultWorkflow](rapidata/api_client/docs/GetWorkflowByIdResultWorkflow.md)
|
|
260
262
|
- [GetWorkflowProgressResult](rapidata/api_client/docs/GetWorkflowProgressResult.md)
|
|
@@ -380,9 +382,9 @@ Class | Method | HTTP request | Description
|
|
|
380
382
|
- [ValidationChance](rapidata/api_client/docs/ValidationChance.md)
|
|
381
383
|
- [ValidationImportPostRequestBlueprint](rapidata/api_client/docs/ValidationImportPostRequestBlueprint.md)
|
|
382
384
|
- [ValidationSelection](rapidata/api_client/docs/ValidationSelection.md)
|
|
383
|
-
- [
|
|
385
|
+
- [ValidationSetModel](rapidata/api_client/docs/ValidationSetModel.md)
|
|
386
|
+
- [ValidationSetModelPagedResult](rapidata/api_client/docs/ValidationSetModelPagedResult.md)
|
|
384
387
|
- [ValidationSetOverviewModel](rapidata/api_client/docs/ValidationSetOverviewModel.md)
|
|
385
|
-
- [ValidationSetPagedResult](rapidata/api_client/docs/ValidationSetPagedResult.md)
|
|
386
388
|
- [WorkflowAggregationStepModel](rapidata/api_client/docs/WorkflowAggregationStepModel.md)
|
|
387
389
|
- [WorkflowArtifactModel](rapidata/api_client/docs/WorkflowArtifactModel.md)
|
|
388
390
|
- [WorkflowConfigArtifactModel](rapidata/api_client/docs/WorkflowConfigArtifactModel.md)
|
|
@@ -47,9 +47,10 @@ class RapidataValidationSet:
|
|
|
47
47
|
Get a `ValidationSet` either by using `rapi.get_validation_set(id)` to get an existing validation set or by using `rapi.new_validation_set(name)` to create a new validation set.
|
|
48
48
|
"""
|
|
49
49
|
|
|
50
|
-
def __init__(self, validation_set_id, openapi_service: OpenAPIService):
|
|
50
|
+
def __init__(self, validation_set_id, openapi_service: OpenAPIService, name: str):
|
|
51
51
|
self.id = validation_set_id
|
|
52
52
|
self.openapi_service = openapi_service
|
|
53
|
+
self.name = name
|
|
53
54
|
|
|
54
55
|
def add_general_validation_rapid(
|
|
55
56
|
self,
|
|
@@ -153,7 +154,7 @@ class RapidataValidationSet:
|
|
|
153
154
|
else:
|
|
154
155
|
raise ValueError("Invalid asset type")
|
|
155
156
|
|
|
156
|
-
def
|
|
157
|
+
def add_classify_rapid(
|
|
157
158
|
self,
|
|
158
159
|
asset: MediaAsset | TextAsset,
|
|
159
160
|
question: str,
|
|
@@ -188,7 +189,7 @@ class RapidataValidationSet:
|
|
|
188
189
|
randomCorrectProbability=len(truths) / len(categories),
|
|
189
190
|
)
|
|
190
191
|
|
|
191
|
-
def
|
|
192
|
+
def add_compare_rapid(
|
|
192
193
|
self,
|
|
193
194
|
asset: MultiAsset,
|
|
194
195
|
question: str,
|
|
@@ -225,7 +226,7 @@ class RapidataValidationSet:
|
|
|
225
226
|
randomCorrectProbability=1 / len(asset),
|
|
226
227
|
)
|
|
227
228
|
|
|
228
|
-
def
|
|
229
|
+
def add_transcription_rapid(
|
|
229
230
|
self,
|
|
230
231
|
asset: MediaAsset | TextAsset,
|
|
231
232
|
question: str,
|
|
@@ -20,6 +20,8 @@ from rapidata.api_client.models.root_filter import RootFilter
|
|
|
20
20
|
from rapidata.api_client.models.filter import Filter
|
|
21
21
|
from rapidata.api_client.models.sort_criterion import SortCriterion
|
|
22
22
|
|
|
23
|
+
from rapidata.api_client.models.query_validation_set_model import QueryValidationSetModel
|
|
24
|
+
|
|
23
25
|
|
|
24
26
|
class RapidataClient:
|
|
25
27
|
"""The Rapidata client is the main entry point for interacting with the Rapidata API. It allows you to create orders and validation sets. For creating a new order, check out `new_order()`. For creating a new validation set, check out `new_validation_set()`."""
|
|
@@ -71,17 +73,6 @@ class RapidataClient:
|
|
|
71
73
|
"""
|
|
72
74
|
return ValidationSetBuilder(name=name, openapi_service=self.openapi_service)
|
|
73
75
|
|
|
74
|
-
def get_validation_set(self, validation_set_id: str) -> RapidataValidationSet:
|
|
75
|
-
"""Get a validation set by ID.
|
|
76
|
-
|
|
77
|
-
Args:
|
|
78
|
-
validation_set_id (str): The ID of the validation set.
|
|
79
|
-
|
|
80
|
-
Returns:
|
|
81
|
-
RapidataValidationSet: The ValidationSet instance.
|
|
82
|
-
"""
|
|
83
|
-
return RapidataValidationSet(validation_set_id, self.openapi_service)
|
|
84
|
-
|
|
85
76
|
def get_order(self, order_id: str) -> RapidataOrder:
|
|
86
77
|
"""Get an order by ID.
|
|
87
78
|
|
|
@@ -132,6 +123,39 @@ class RapidataClient:
|
|
|
132
123
|
|
|
133
124
|
orders = [self.get_order(order.id) for order in order_page_result.items]
|
|
134
125
|
return orders
|
|
126
|
+
|
|
127
|
+
def get_validation_set(self, validation_set_id: str) -> RapidataValidationSet:
|
|
128
|
+
"""Get a validation set by ID.
|
|
129
|
+
|
|
130
|
+
Args:
|
|
131
|
+
validation_set_id (str): The ID of the validation set.
|
|
132
|
+
|
|
133
|
+
Returns:
|
|
134
|
+
RapidataValidationSet: The ValidationSet instance.
|
|
135
|
+
"""
|
|
136
|
+
try:
|
|
137
|
+
validation_set = self.openapi_service.validation_api.validation_get_by_id_get(id=validation_set_id)
|
|
138
|
+
except Exception:
|
|
139
|
+
raise ValueError(f"ValidationSet with ID {validation_set_id} not found.")
|
|
140
|
+
|
|
141
|
+
return RapidataValidationSet(validation_set_id, self.openapi_service, validation_set.name)
|
|
142
|
+
|
|
143
|
+
def find_validation_sets(self, name: str = "", amount: int = 1) -> list[RapidataValidationSet]:
|
|
144
|
+
try:
|
|
145
|
+
validation_page_result = self.openapi_service.validation_api.validation_query_validation_sets_get(QueryValidationSetModel(
|
|
146
|
+
pageInfo=PageInfo(index=1, size=amount),
|
|
147
|
+
filter=RootFilter(filters=[Filter(field="Name", operator="Contains", value=name)]),
|
|
148
|
+
sortCriteria=[SortCriterion(direction="Desc", propertyName="CreatedAt")]
|
|
149
|
+
))
|
|
150
|
+
|
|
151
|
+
except BadRequestException as e:
|
|
152
|
+
raise ValueError(f"Error occured during request. \nError: {e.body} \nTraceid: {e.headers.get('X-Trace-Id') if isinstance(e.headers, HTTPHeaderDict) else 'Unknown'}")
|
|
153
|
+
|
|
154
|
+
except Exception as e:
|
|
155
|
+
raise ValueError(f"Unknown error occured: {e}")
|
|
156
|
+
|
|
157
|
+
orders = [self.get_validation_set(validation_set.id) for validation_set in validation_page_result.items] # type: ignore # will be fixed with the next backend deployment
|
|
158
|
+
return orders
|
|
135
159
|
|
|
136
160
|
def create_classify_order(self, name: str) -> ClassificationQuestionBuilder:
|
|
137
161
|
"""Create a new classification order where people are asked to classify an image.
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import json
|
|
2
|
+
import time
|
|
2
3
|
import requests
|
|
4
|
+
import threading
|
|
3
5
|
from rapidata.api_client.api.campaign_api import CampaignApi
|
|
4
6
|
from rapidata.api_client.api.dataset_api import DatasetApi
|
|
5
7
|
from rapidata.api_client.api.order_api import OrderApi
|
|
@@ -13,6 +15,8 @@ from rapidata.api_client.configuration import Configuration
|
|
|
13
15
|
|
|
14
16
|
class OpenAPIService:
|
|
15
17
|
|
|
18
|
+
_TOKEN_EXPIRATION_MINUTES = 30
|
|
19
|
+
|
|
16
20
|
def __init__(
|
|
17
21
|
self,
|
|
18
22
|
client_id: str,
|
|
@@ -20,18 +24,41 @@ class OpenAPIService:
|
|
|
20
24
|
endpoint: str,
|
|
21
25
|
token_url: str,
|
|
22
26
|
oauth_scope: str,
|
|
23
|
-
cert_path: str | None = None
|
|
27
|
+
cert_path: str | None = None
|
|
24
28
|
):
|
|
25
29
|
client_configuration = Configuration(host=endpoint, ssl_ca_cert=cert_path)
|
|
26
30
|
self.api_client = ApiClient(configuration=client_configuration)
|
|
27
31
|
|
|
28
|
-
|
|
32
|
+
self._client_id = client_id
|
|
33
|
+
self._client_secret = client_secret
|
|
34
|
+
self._oauth_scope = oauth_scope
|
|
35
|
+
self._token_url = token_url
|
|
36
|
+
self._cert_path = cert_path
|
|
29
37
|
|
|
30
|
-
client_configuration.api_key["bearer"] = f"Bearer {token}"
|
|
31
38
|
self._api_client = ApiClient()
|
|
32
39
|
self._order_api = OrderApi(self.api_client)
|
|
33
40
|
self._dataset_api = DatasetApi(self.api_client)
|
|
34
41
|
|
|
42
|
+
api_token = self.__fetch_token(
|
|
43
|
+
self._client_id, self._client_secret, self._oauth_scope, self._token_url, self._cert_path
|
|
44
|
+
)
|
|
45
|
+
self.api_client.configuration.api_key["bearer"] = f"Bearer {api_token}"
|
|
46
|
+
|
|
47
|
+
refresh_thread = threading.Thread(
|
|
48
|
+
target=lambda: self.__refresh_token_periodically(self._TOKEN_EXPIRATION_MINUTES - 1)
|
|
49
|
+
)
|
|
50
|
+
refresh_thread.daemon = True
|
|
51
|
+
refresh_thread.start()
|
|
52
|
+
|
|
53
|
+
def __refresh_token_periodically(self, refresh_interval):
|
|
54
|
+
while True:
|
|
55
|
+
new_token = self.__fetch_token(
|
|
56
|
+
self._client_id, self._client_secret, self._oauth_scope, self._token_url, self._cert_path
|
|
57
|
+
)
|
|
58
|
+
self.api_client.configuration.api_key["bearer"] = f"Bearer {new_token}"
|
|
59
|
+
|
|
60
|
+
time.sleep(refresh_interval)
|
|
61
|
+
|
|
35
62
|
@property
|
|
36
63
|
def order_api(self) -> OrderApi:
|
|
37
64
|
return self._order_api
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
rapidata/__init__.py,sha256=xkV2cgV_RBZCW8CNxWFMlf4EFJUWXcJnqfzQtJsG6NA,579
|
|
2
|
-
rapidata/api_client/__init__.py,sha256=
|
|
2
|
+
rapidata/api_client/__init__.py,sha256=qjZpyMWRZgTrH3dtHsT1niqRKVVU92e_HCsoH2H8ypc,23396
|
|
3
3
|
rapidata/api_client/api/__init__.py,sha256=S0oVoAVMys10M-Z1SqirMdnHMYSHH3Lz6iph1CfILc0,1004
|
|
4
4
|
rapidata/api_client/api/campaign_api.py,sha256=DxPFqt9F6c9OpXu_Uxhsrib2NVwnbcZFa3Vkrj7cIuA,40474
|
|
5
5
|
rapidata/api_client/api/coco_api.py,sha256=4QYkW7c0SZvs-HOYmj585yL0KNr6Xc16ajS7b72yI6w,24972
|
|
@@ -14,13 +14,13 @@ rapidata/api_client/api/rapid_api.py,sha256=q7LJiweMnln2fs_KOzwVlO4bEk564kNkvPsc
|
|
|
14
14
|
rapidata/api_client/api/rapidata_identity_api_api.py,sha256=-kgoDuLdh-R4MQ7JPi3kQ0WDFKbmI0MkCjxwHXBmksA,9824
|
|
15
15
|
rapidata/api_client/api/simple_workflow_api.py,sha256=BIc4Cx05cbd_5BV0Rsb44M3uMlQZ5IB_6iHyNbbAZiU,15440
|
|
16
16
|
rapidata/api_client/api/user_info_api.py,sha256=FuuA95Beeky-rnqIoSUe2-WQ7oVTfq0RElX0jfKXT0w,10042
|
|
17
|
-
rapidata/api_client/api/validation_api.py,sha256=
|
|
17
|
+
rapidata/api_client/api/validation_api.py,sha256=U6OQUhZ-5C895GWi2iz4pAfmSTHfyRhdtoYcbFoNcnA,90019
|
|
18
18
|
rapidata/api_client/api/workflow_api.py,sha256=prRrSAVTiPqw2w2PS0-TVFRS7ycS9sMCNE-Sz-ESnfk,52882
|
|
19
19
|
rapidata/api_client/api_client.py,sha256=EDhxAOUc5JFWvFsF1zc726Q7GoEFkuB8uor5SlGx9K4,27503
|
|
20
20
|
rapidata/api_client/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
|
|
21
21
|
rapidata/api_client/configuration.py,sha256=g472vHVPLBotq8EkfSXP4sbp7xnn-3sb8O8BBlRWK1I,15931
|
|
22
22
|
rapidata/api_client/exceptions.py,sha256=eLLd1fxM0Ygf3IIG6aNx9hdy79drst5Cem0UjI_NamM,5978
|
|
23
|
-
rapidata/api_client/models/__init__.py,sha256=
|
|
23
|
+
rapidata/api_client/models/__init__.py,sha256=ORUPTcjrZCCLWcP4flfRBESc2lIjTmzFOe42K6tJRDY,21851
|
|
24
24
|
rapidata/api_client/models/add_campaign_artifact_result.py,sha256=4IvFVS-tLlL6eHsWp-IZ_ul5T30-h3YEwd2B5ioBbgY,2582
|
|
25
25
|
rapidata/api_client/models/add_campaign_model.py,sha256=OJzkfvQlrp6j6ffwVShouUCW-MQZw60BGUJpqjbSGs8,6853
|
|
26
26
|
rapidata/api_client/models/add_validation_rapid_model.py,sha256=-HRHMK-o6dgGjUqfsP_woZcFxfN7nuJ-L1CUaK9nihY,4918
|
|
@@ -153,6 +153,7 @@ rapidata/api_client/models/get_pipeline_by_id_result.py,sha256=JB4kJasul1r298p5P
|
|
|
153
153
|
rapidata/api_client/models/get_pipeline_by_id_result_artifacts_value.py,sha256=tvh4GD4YeU9VnXKWLiqTfqGsC-90hUa_zAd-qkcwEPs,8476
|
|
154
154
|
rapidata/api_client/models/get_public_orders_result.py,sha256=1Eq-R7wX2fKREuu-o1u5pVqHnc89-_--pkz78y80oEM,3001
|
|
155
155
|
rapidata/api_client/models/get_simple_workflow_result_overview_result.py,sha256=ThHj63FCET3FcfC8jBjTG8opL2ZUMwg4BZFIzXFaC8I,6554
|
|
156
|
+
rapidata/api_client/models/get_validation_set_by_id_result.py,sha256=dsonFbNl_Zj4mwUmo4Hc6QSDfpc1MDaiFzbEC3Ta_Uo,2845
|
|
156
157
|
rapidata/api_client/models/get_workflow_by_id_result.py,sha256=l8DvKolvRGJQtMuTXLVwJuCN0eaSET-gi0p6TV6phuQ,2886
|
|
157
158
|
rapidata/api_client/models/get_workflow_by_id_result_workflow.py,sha256=Pc-kq2AnoxqVQmJj52Fptyb-RoTihwq73GpODiw6trk,5735
|
|
158
159
|
rapidata/api_client/models/get_workflow_config_result.py,sha256=2JiFcYzAsiUOheWrg1bL6RYuQqAvrn2WaL9pZpQZh1w,3023
|
|
@@ -237,7 +238,7 @@ rapidata/api_client/models/query_validation_rapids_result_paged_result.py,sha256
|
|
|
237
238
|
rapidata/api_client/models/query_validation_set_model.py,sha256=FIPvd0-wXvK-GTdtj_ZvQEcsLt2B8wTXb6-33WujkBY,4239
|
|
238
239
|
rapidata/api_client/models/query_workflows_model.py,sha256=Y3HuKLbtLlejEQsJyVZ-vLN6AJExWoLo1SQmLFWX4vw,4135
|
|
239
240
|
rapidata/api_client/models/ranked_datapoint_model.py,sha256=c9Q5iqRPvNd-2x_1t9SRE7wI0optxB67Z-tE8V4D2lM,3087
|
|
240
|
-
rapidata/api_client/models/rapid_answer.py,sha256=
|
|
241
|
+
rapidata/api_client/models/rapid_answer.py,sha256=IvDuJNJlkBUjI3Q5STq6SL48FzEsfXQ9N1TsJ_TO4ig,3282
|
|
241
242
|
rapidata/api_client/models/rapid_answer_result.py,sha256=oXYHKpjkXa_cxgJb8xUR_v8jo6RV06nLxLxXEGVrhAY,11634
|
|
242
243
|
rapidata/api_client/models/rapid_result_model.py,sha256=JVUSCNErUbZimSIelKb7pgXjxdaHFX6ZjKahuRLbe7w,3048
|
|
243
244
|
rapidata/api_client/models/rapid_result_model_result.py,sha256=RjA75vGoZW5fEHLxS3-z1TUesyax_qxPXW4aYhGFoPw,11681
|
|
@@ -299,6 +300,8 @@ rapidata/api_client/models/validation_import_post_request_blueprint.py,sha256=KI
|
|
|
299
300
|
rapidata/api_client/models/validation_rapid_selection_config.py,sha256=T6RoGq_YSytk_TAcWsfOsU_7nfQlLmnO4Qn0CkQok7k,3219
|
|
300
301
|
rapidata/api_client/models/validation_selection.py,sha256=sgq3YtlKdAx2Ec41jFlZG1QNkN1NVwOJL-ALGxq3iL4,3131
|
|
301
302
|
rapidata/api_client/models/validation_set.py,sha256=8ogEXVaKNB9pR2xuouf_Ckz_6-ryV0usGxx2qPqKjQk,3386
|
|
303
|
+
rapidata/api_client/models/validation_set_model.py,sha256=79-5JwNDk51WtlXO0CHfjnO70AcyK_ErjZqBqmSYBFs,2916
|
|
304
|
+
rapidata/api_client/models/validation_set_model_paged_result.py,sha256=KFdXjw6qkzGXLIHYlVSxfSYPpBPHTxEi4e6qGBzCIlk,3518
|
|
302
305
|
rapidata/api_client/models/validation_set_overview_model.py,sha256=wlrjXg1dmlFmP8rIKDR88pGzpUEg15t8esr63BfYaaE,2693
|
|
303
306
|
rapidata/api_client/models/validation_set_paged_result.py,sha256=3ch0KcbcH7qn8iJPY90WIiTF_MAIPJxWa3DUNfKwSI0,3477
|
|
304
307
|
rapidata/api_client/models/workflow_aggregation_step_model.py,sha256=6LWLE1aY9P5u3YbbMZFcUDrREP8YiYypOw6Wrmxc0gs,4467
|
|
@@ -310,7 +313,7 @@ rapidata/api_client/models/workflow_split_model.py,sha256=zthOSaUl8dbLhLymLK_lrP
|
|
|
310
313
|
rapidata/api_client/models/workflow_split_model_filter_configs_inner.py,sha256=1Fx9uZtztiiAdMXkj7YeCqt7o6VkG9lKf7D7UP_h088,7447
|
|
311
314
|
rapidata/api_client/models/workflow_state.py,sha256=5LAK1se76RCoozeVB6oxMPb8p_5bhLZJqn7q5fFQWis,850
|
|
312
315
|
rapidata/api_client/rest.py,sha256=zmCIFQC2l1t-KZcq-TgEm3vco3y_LK6vRm3Q07K-xRI,9423
|
|
313
|
-
rapidata/api_client_README.md,sha256=
|
|
316
|
+
rapidata/api_client_README.md,sha256=wSrVJxrpMg3zHtVmiiPgmFB8_8PQLQkkk4a0595zcHc,34887
|
|
314
317
|
rapidata/rapidata_client/__init__.py,sha256=2SsfOqLpkTh6b0wTKwUaBboxwuU9_SvP4TK-eUoocGo,795
|
|
315
318
|
rapidata/rapidata_client/assets/__init__.py,sha256=T-XKvMSkmyI8iYLUYDdZ3LrrSInHsGMUY_Tz77hhnlE,240
|
|
316
319
|
rapidata/rapidata_client/assets/base_asset.py,sha256=B2YWH1NgaeYUYHDW3OPpHM_bqawHbH4EjnRCE2BYwiM,298
|
|
@@ -322,9 +325,9 @@ rapidata/rapidata_client/country_codes/__init__.py,sha256=FB9Dcks44J6C6YBSYmTmNZ
|
|
|
322
325
|
rapidata/rapidata_client/country_codes/country_codes.py,sha256=Q0HMX7uHJQDeLCFPP5bq4iYi6pgcDWEcl2ONGhjgoeU,286
|
|
323
326
|
rapidata/rapidata_client/dataset/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
324
327
|
rapidata/rapidata_client/dataset/rapidata_dataset.py,sha256=12mvcpHa-ZpDOFhSuqnSb6pFhR1q7rF98fgiDBuONdw,4935
|
|
325
|
-
rapidata/rapidata_client/dataset/rapidata_validation_set.py,sha256=
|
|
328
|
+
rapidata/rapidata_client/dataset/rapidata_validation_set.py,sha256=KhvHMML591h61I9lqXSmp_s2_VZAWmuCoixmA2rAI8c,10973
|
|
326
329
|
rapidata/rapidata_client/dataset/validation_rapid_parts.py,sha256=uzpOZFqQu8bG6vmjcWWUNJPZsRe28OmnyalRE6ry8tk,2317
|
|
327
|
-
rapidata/rapidata_client/dataset/validation_set_builder.py,sha256=
|
|
330
|
+
rapidata/rapidata_client/dataset/validation_set_builder.py,sha256=ApYyEIwf9CQfnKJ2nZwK9FzgnY3Ff3BWetv75OlR-KM,8018
|
|
328
331
|
rapidata/rapidata_client/feature_flags/__init__.py,sha256=IYkcK_bZCl5RfyQFiWjjUdz4y0jipiW9qfeopq4EjQQ,40
|
|
329
332
|
rapidata/rapidata_client/feature_flags/feature_flags.py,sha256=ESwPY0mHDCzY_rjYastl1rWZVbmt-3gc9lHQdwgGfGo,4479
|
|
330
333
|
rapidata/rapidata_client/filter/__init__.py,sha256=F3JsMCbAZWH7SNdgaj98ydTqgCCKXKBhLyt9gQ4x6tQ,301
|
|
@@ -344,7 +347,7 @@ rapidata/rapidata_client/metadata/transcription_metadata.py,sha256=THtDEVCON4Ulc
|
|
|
344
347
|
rapidata/rapidata_client/order/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
345
348
|
rapidata/rapidata_client/order/rapidata_order.py,sha256=IMozRlrYK_yqGLk0GQbLNYL_RRb7gUcSgDe6NUjOEEE,4812
|
|
346
349
|
rapidata/rapidata_client/order/rapidata_order_builder.py,sha256=QvICzduLAuAkf8qFKxHV3zAag838WnV9lEzWdD4dxI0,15926
|
|
347
|
-
rapidata/rapidata_client/rapidata_client.py,sha256=
|
|
350
|
+
rapidata/rapidata_client/rapidata_client.py,sha256=2C-iyRIUYCStxgmNPj95IF8cSZ1c-8W0f71mxiyzqcs,8309
|
|
348
351
|
rapidata/rapidata_client/referee/__init__.py,sha256=E1VODxTjoQRnxzdgMh3aRlDLouxe1nWuvozEHXD2gq4,150
|
|
349
352
|
rapidata/rapidata_client/referee/base_referee.py,sha256=bMy7cw0a-pGNbFu6u_1_Jplu0A483Ubj4oDQzh8vu8k,493
|
|
350
353
|
rapidata/rapidata_client/referee/early_stopping_referee.py,sha256=Dg2Kk7OiLBtS3kknsLxyJIlS27xmPvsikFR6g4xlbTE,1862
|
|
@@ -370,10 +373,10 @@ rapidata/rapidata_client/workflow/free_text_workflow.py,sha256=VaypoG3yKgsbtVyqx
|
|
|
370
373
|
rapidata/rapidata_client/workflow/transcription_workflow.py,sha256=_KDtGCdRhauJm3jQHpwhY-Hq79CLg5I8q2RgOz5lo1g,1404
|
|
371
374
|
rapidata/service/__init__.py,sha256=s9bS1AJZaWIhLtJX_ZA40_CK39rAAkwdAmymTMbeWl4,68
|
|
372
375
|
rapidata/service/local_file_service.py,sha256=pgorvlWcx52Uh3cEG6VrdMK_t__7dacQ_5AnfY14BW8,877
|
|
373
|
-
rapidata/service/openapi_service.py,sha256=
|
|
376
|
+
rapidata/service/openapi_service.py,sha256=l-ga9TLKWR6Gwx9nbDSQ2J1HZRPhgk_mGgnC3kud3uw,3688
|
|
374
377
|
rapidata/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
375
378
|
rapidata/utils/image_utils.py,sha256=TldO3eJWG8IhfJjm5MfNGO0mEDm1mQTsRoA0HLU1Uxs,404
|
|
376
|
-
rapidata-1.
|
|
377
|
-
rapidata-1.
|
|
378
|
-
rapidata-1.
|
|
379
|
-
rapidata-1.
|
|
379
|
+
rapidata-1.5.0.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
380
|
+
rapidata-1.5.0.dist-info/METADATA,sha256=7zYO1LRXEK4WJDtWjahatmvMegUDqQhBsTUOHTChW1k,1012
|
|
381
|
+
rapidata-1.5.0.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
|
382
|
+
rapidata-1.5.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|