supervisely 6.73.201__py3-none-any.whl → 6.73.202__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 supervisely might be problematic. Click here for more details.

@@ -806,6 +806,40 @@ class FileApi(ModuleApiBase):
806
806
  api.file.upload_bulk(8, src_paths, dst_remote_paths)
807
807
  """
808
808
 
809
+ def _group_files_generator(
810
+ src_paths: List[str], dst_paths: List[str], limit: int = 20 * 1024 * 1024
811
+ ):
812
+ if limit is None:
813
+ return src_paths, dst_paths
814
+ group_src = []
815
+ group_dst = []
816
+ total_size = 0
817
+ for src, dst in zip(src_paths, dst_paths):
818
+ size = os.path.getsize(src)
819
+ if total_size > 0 and total_size + size > limit:
820
+ yield group_src, group_dst
821
+ group_src = []
822
+ group_dst = []
823
+ total_size = 0
824
+ group_src.append(src)
825
+ group_dst.append(dst)
826
+ total_size += size
827
+ if total_size > 0:
828
+ yield group_src, group_dst
829
+
830
+ file_infos = []
831
+ for src, dst in _group_files_generator(src_paths, dst_paths):
832
+ file_infos.extend(self._upload_bulk(team_id, src, dst, progress_cb))
833
+ return file_infos
834
+
835
+ def _upload_bulk(
836
+ self,
837
+ team_id: int,
838
+ src_paths: List[str],
839
+ dst_paths: List[str],
840
+ progress_cb: Optional[Union[tqdm, Callable]] = None,
841
+ ) -> List[FileInfo]:
842
+
809
843
  def path_to_bytes_stream(path):
810
844
  return open(path, "rb")
811
845
 
@@ -1338,7 +1372,7 @@ class FileApi(ModuleApiBase):
1338
1372
  """
1339
1373
  if not remote_dir.startswith("/"):
1340
1374
  remote_dir = "/" + remote_dir
1341
-
1375
+
1342
1376
  if self.dir_exists(team_id, remote_dir):
1343
1377
  if change_name_if_conflict is True:
1344
1378
  res_remote_dir = self.get_free_dir_name(team_id, remote_dir)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: supervisely
3
- Version: 6.73.201
3
+ Version: 6.73.202
4
4
  Summary: Supervisely Python SDK.
5
5
  Home-page: https://github.com/supervisely/supervisely
6
6
  Author: Supervisely
@@ -25,7 +25,7 @@ supervisely/api/annotation_api.py,sha256=Eps-Jf10_SQFy7DjghUnyiM6DcVJBsamHDViRAX
25
25
  supervisely/api/api.py,sha256=u2T0yOQ-tUnP3iIzFu8zEQb4t_EDrXQSKnaXHCvFDyg,36514
26
26
  supervisely/api/app_api.py,sha256=zX3Iy16RuGwtcLZfMs3YfUFc93S9AVGb3W_eINeMjOs,66729
27
27
  supervisely/api/dataset_api.py,sha256=7iwAyz3pmzFG2i072gLdXjczfBGbyj-V_rRl7Tx-V30,37944
28
- supervisely/api/file_api.py,sha256=ouqhqlFbBjxbpuf1hvUAJPIfabnxIzHqL3JDu-lUmHI,53094
28
+ supervisely/api/file_api.py,sha256=y8FkE-vx1382cbhNo_rTZs7SobrkxmYQAe79CpvStO4,54279
29
29
  supervisely/api/github_api.py,sha256=NIexNjEer9H5rf5sw2LEZd7C1WR-tK4t6IZzsgeAAwQ,623
30
30
  supervisely/api/image_annotation_tool_api.py,sha256=YcUo78jRDBJYvIjrd-Y6FJAasLta54nnxhyaGyanovA,5237
31
31
  supervisely/api/image_api.py,sha256=1AgY6Tk-0rJf1miR5kN1YSkQ7EVihgBnPWbP-Ic55NI,135790
@@ -953,9 +953,9 @@ supervisely/worker_proto/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZ
953
953
  supervisely/worker_proto/worker_api_pb2.py,sha256=VQfi5JRBHs2pFCK1snec3JECgGnua3Xjqw_-b3aFxuM,59142
954
954
  supervisely/worker_proto/worker_api_pb2_grpc.py,sha256=3BwQXOaP9qpdi0Dt9EKG--Lm8KGN0C5AgmUfRv77_Jk,28940
955
955
  supervisely_lib/__init__.py,sha256=7-3QnN8Zf0wj8NCr2oJmqoQWMKKPKTECvjH9pd2S5vY,159
956
- supervisely-6.73.201.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
957
- supervisely-6.73.201.dist-info/METADATA,sha256=ZY58o7Meo4VBsGD1N9EDwkQ9cO9c5ECQoopB--t71WY,33077
958
- supervisely-6.73.201.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
959
- supervisely-6.73.201.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
960
- supervisely-6.73.201.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
961
- supervisely-6.73.201.dist-info/RECORD,,
956
+ supervisely-6.73.202.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
957
+ supervisely-6.73.202.dist-info/METADATA,sha256=MUPM7KGiNv7G7N0NuTuSD2xmPsAkklij4YUNiS8hknM,33077
958
+ supervisely-6.73.202.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
959
+ supervisely-6.73.202.dist-info/entry_points.txt,sha256=U96-5Hxrp2ApRjnCoUiUhWMqijqh8zLR03sEhWtAcms,102
960
+ supervisely-6.73.202.dist-info/top_level.txt,sha256=kcFVwb7SXtfqZifrZaSE3owHExX4gcNYe7Q2uoby084,28
961
+ supervisely-6.73.202.dist-info/RECORD,,