unitlab 2.4.4__tar.gz → 2.4.5__tar.gz
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.
- {unitlab-2.4.4 → unitlab-2.4.5}/PKG-INFO +1 -1
- {unitlab-2.4.4 → unitlab-2.4.5}/pyproject.toml +1 -1
- {unitlab-2.4.4 → unitlab-2.4.5}/src/unitlab/client.py +10 -37
- {unitlab-2.4.4 → unitlab-2.4.5}/.claude/settings.local.json +0 -0
- {unitlab-2.4.4 → unitlab-2.4.5}/.gitignore +0 -0
- {unitlab-2.4.4 → unitlab-2.4.5}/LICENSE.md +0 -0
- {unitlab-2.4.4 → unitlab-2.4.5}/README.md +0 -0
- {unitlab-2.4.4 → unitlab-2.4.5}/src/unitlab/__init__.py +0 -0
- {unitlab-2.4.4 → unitlab-2.4.5}/src/unitlab/__main__.py +0 -0
- {unitlab-2.4.4 → unitlab-2.4.5}/src/unitlab/_config.py +0 -0
- {unitlab-2.4.4 → unitlab-2.4.5}/src/unitlab/cli.py +0 -0
- {unitlab-2.4.4 → unitlab-2.4.5}/src/unitlab/exceptions.py +0 -0
|
@@ -308,49 +308,20 @@ class UnitlabClient:
|
|
|
308
308
|
def datasets(self, pretty: int = 0) -> Any:
|
|
309
309
|
return self._get(f"/api/sdk/datasets/?pretty={pretty}")
|
|
310
310
|
|
|
311
|
-
def dataset_info(self, dataset_id: str) -> Any:
|
|
312
|
-
"""Return metadata for a dataset.
|
|
313
|
-
|
|
314
|
-
Includes name, version, annotation_type, number_of_data,
|
|
315
|
-
download_formats and the list of available ``splits``.
|
|
316
|
-
"""
|
|
317
|
-
return self._get(f"/api/sdk/datasets/{dataset_id}/")
|
|
318
|
-
|
|
319
311
|
def dataset_download(
|
|
320
312
|
self,
|
|
321
313
|
dataset_id: str,
|
|
322
314
|
export_type: str,
|
|
323
315
|
split_type: str | None = None,
|
|
324
316
|
) -> str:
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
"No splits available for this dataset. Nothing to download."
|
|
332
|
-
),
|
|
333
|
-
detail=None,
|
|
334
|
-
)
|
|
335
|
-
if len(splits) > 1:
|
|
336
|
-
raise NetworkError(
|
|
337
|
-
message=(
|
|
338
|
-
f"Multiple splits available: {', '.join(splits)}. "
|
|
339
|
-
f"Specify one with split_type=..."
|
|
340
|
-
),
|
|
341
|
-
detail=None,
|
|
342
|
-
)
|
|
343
|
-
split_type = splits[0]
|
|
344
|
-
logger.info(f"Auto-selected split: {split_type}")
|
|
317
|
+
data: dict[str, Any] = {
|
|
318
|
+
"download_type": "annotation",
|
|
319
|
+
"export_type": export_type,
|
|
320
|
+
}
|
|
321
|
+
if split_type is not None:
|
|
322
|
+
data["split_type"] = split_type
|
|
345
323
|
|
|
346
|
-
response = self._post(
|
|
347
|
-
f"/api/sdk/datasets/{dataset_id}/",
|
|
348
|
-
data={
|
|
349
|
-
"download_type": "annotation",
|
|
350
|
-
"export_type": export_type,
|
|
351
|
-
"split_type": split_type,
|
|
352
|
-
},
|
|
353
|
-
)
|
|
324
|
+
response = self._post(f"/api/sdk/datasets/{dataset_id}/", data=data)
|
|
354
325
|
|
|
355
326
|
file_url = response["file"]
|
|
356
327
|
try:
|
|
@@ -429,7 +400,9 @@ class UnitlabClient:
|
|
|
429
400
|
|
|
430
401
|
async def main() -> None:
|
|
431
402
|
with tqdm.tqdm(total=len(files_to_download), ncols=80) as pbar:
|
|
432
|
-
async with httpx.AsyncClient(
|
|
403
|
+
async with httpx.AsyncClient(
|
|
404
|
+
timeout=600.0, follow_redirects=True
|
|
405
|
+
) as client:
|
|
433
406
|
tasks = [
|
|
434
407
|
download_file(client=client, dataset_file=df)
|
|
435
408
|
for df in files_to_download
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|