tracktolib 0.47.2__py3-none-any.whl → 0.48.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.
tracktolib/s3/s3.py CHANGED
@@ -51,12 +51,40 @@ async def download_file(client: AioBaseClient, bucket: str, path: str) -> BytesI
51
51
  return _file
52
52
 
53
53
 
54
- async def delete_file(client: AioBaseClient, bucket: str, path: str) -> bool:
54
+ async def delete_file(client: AioBaseClient, bucket: str, path: str) -> dict:
55
55
  """
56
- Delete a file from a s3 bucket.
57
- Returns True if the file exists else False
56
+ Delete a file from an S3 bucket.
57
+
58
+ Args:
59
+ client (AioBaseClient): The client to interact with the S3 service.
60
+ bucket (str): The name of the S3 bucket.
61
+ path (str): The path to the file within the S3 bucket.
62
+
63
+ Return:
64
+ dict: The response from the S3 service after attempting to delete the file.
65
+ This typically includes metadata about the operation, such as HTTP status code,
66
+ any errors encountered, and information about the deleted object.
67
+ """
68
+ return await client.delete_object(Bucket=bucket, Key=path) # type:ignore
69
+
70
+
71
+ async def delete_files(client: AioBaseClient, bucket: str, paths: list[str], quiet: bool = True) -> dict:
72
+ """
73
+ Delete multiple files from an S3 bucket.
74
+
75
+ Args:
76
+ client (AioBaseClient): The client to interact with the S3 service.
77
+ bucket (str): The name of the S3 bucket.
78
+ paths (str): The paths to the files to delete within the S3 bucket.
79
+ quiet (bool): Whether to suppress printing messages to stdout (default: True).
80
+
81
+ Return:
82
+ dict: The response from the S3 service after attempting to delete the files.
83
+ This typically includes metadata about the operation, such as HTTP status code,
84
+ any errors encountered, and information about the deleted object.
58
85
  """
59
- return await client.delete_object(Bucket=bucket, Key=path) # type: ignore
86
+ delete_request = {"Objects": [{"Key": path} for path in paths], "Quiet": quiet}
87
+ return await client.delete_objects(Bucket=bucket, Delete=delete_request) # type:ignore
60
88
 
61
89
 
62
90
  class S3Item(TypedDict):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tracktolib
3
- Version: 0.47.2
3
+ Version: 0.48.0
4
4
  Summary: Utility library for python
5
5
  Home-page: https://github.com/tracktor/tracktolib
6
6
  License: MIT
@@ -10,10 +10,10 @@ tracktolib/pg_sync.py,sha256=pjeHuLmBAkof16FhPXfFyK4nfThEnsISF3US5lzBw-0,5105
10
10
  tracktolib/pg_utils.py,sha256=8DDlZVSgfNie9M-zL7wilFufXMMvSPw5d7aIDs_pQCM,1976
11
11
  tracktolib/s3/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
12
12
  tracktolib/s3/minio.py,sha256=JaRpHOM6NqpMieplp58Fpc7uTh7PItyP8On7jMXhB-Q,1234
13
- tracktolib/s3/s3.py,sha256=0aPUo3Vnfy5Rk_Qp_y0KkCZa2kuMWw2JU2xrodn7oAE,3486
13
+ tracktolib/s3/s3.py,sha256=d0Q63Zb62ef4jAt05zQwpgYvAoxHC9kSQuHzzK90VvE,4825
14
14
  tracktolib/tests.py,sha256=FS0uae3ShiiJOD7WE2WEv9h3QwRJCbLDHpe_8Ikc0j0,554
15
15
  tracktolib/utils.py,sha256=usiUYVwMa43RvqpKJmQDmzhvfahSVMW0OAcyVWWfPkg,5323
16
- tracktolib-0.47.2.dist-info/LICENSE,sha256=uUanH0X7SeZEPdsRTHegMSMTiIHMurt9H0jSwEwKE1Y,1081
17
- tracktolib-0.47.2.dist-info/WHEEL,sha256=vxFmldFsRN_Hx10GDvsdv1wroKq8r5Lzvjp6GZ4OO8c,88
18
- tracktolib-0.47.2.dist-info/METADATA,sha256=uzq6t4LBEv66z96AxENdxDlRwgcaLgoINkIOEQzf4jU,3610
19
- tracktolib-0.47.2.dist-info/RECORD,,
16
+ tracktolib-0.48.0.dist-info/LICENSE,sha256=uUanH0X7SeZEPdsRTHegMSMTiIHMurt9H0jSwEwKE1Y,1081
17
+ tracktolib-0.48.0.dist-info/WHEEL,sha256=vxFmldFsRN_Hx10GDvsdv1wroKq8r5Lzvjp6GZ4OO8c,88
18
+ tracktolib-0.48.0.dist-info/METADATA,sha256=TGeH5iSuqaYGes5t4WMhY6a78oWjWgT-9rtYOEnUCCU,3610
19
+ tracktolib-0.48.0.dist-info/RECORD,,