tracktolib 0.47.2__py3-none-any.whl → 0.48.1__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/api.py +2 -1
- tracktolib/s3/s3.py +32 -4
- {tracktolib-0.47.2.dist-info → tracktolib-0.48.1.dist-info}/METADATA +1 -1
- {tracktolib-0.47.2.dist-info → tracktolib-0.48.1.dist-info}/RECORD +6 -6
- {tracktolib-0.47.2.dist-info → tracktolib-0.48.1.dist-info}/LICENSE +0 -0
- {tracktolib-0.47.2.dist-info → tracktolib-0.48.1.dist-info}/WHEEL +0 -0
tracktolib/api.py
CHANGED
|
@@ -319,7 +319,8 @@ class CamelCaseModel(BaseModel):
|
|
|
319
319
|
|
|
320
320
|
|
|
321
321
|
def check_status(resp, status: int = starlette.status.HTTP_200_OK):
|
|
322
|
-
|
|
322
|
+
if resp.status_code != status:
|
|
323
|
+
raise AssertionError(json.dumps(resp.json(), indent=4))
|
|
323
324
|
|
|
324
325
|
|
|
325
326
|
def generate_list_name_model(model: Type[B], status: int | None = None) -> dict:
|
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) ->
|
|
54
|
+
async def delete_file(client: AioBaseClient, bucket: str, path: str) -> dict:
|
|
55
55
|
"""
|
|
56
|
-
Delete a file from
|
|
57
|
-
|
|
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
|
-
|
|
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
|
LICENSE,sha256=uUanH0X7SeZEPdsRTHegMSMTiIHMurt9H0jSwEwKE1Y,1081
|
|
2
2
|
tracktolib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
tracktolib/api.py,sha256=
|
|
3
|
+
tracktolib/api.py,sha256=UaALaBPTbWICGVxzZIxvSVVWi_DjMzfjtB_vGc-K7sI,9623
|
|
4
4
|
tracktolib/http_utils.py,sha256=dqjRJTNCo1qDnvQBTcImw1ibi1LnqETrpWDAU5txBHs,2633
|
|
5
5
|
tracktolib/logs.py,sha256=enezPjBU4v2s8knG_V6kIbQsoyxfNIKEpKVSSkr_2U8,2212
|
|
6
6
|
tracktolib/pg/__init__.py,sha256=32kKBJzIDyppszZMAOSMgM3ggz7Ow0TaNKiMs740gyw,333
|
|
@@ -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=
|
|
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.
|
|
17
|
-
tracktolib-0.
|
|
18
|
-
tracktolib-0.
|
|
19
|
-
tracktolib-0.
|
|
16
|
+
tracktolib-0.48.1.dist-info/LICENSE,sha256=uUanH0X7SeZEPdsRTHegMSMTiIHMurt9H0jSwEwKE1Y,1081
|
|
17
|
+
tracktolib-0.48.1.dist-info/WHEEL,sha256=vxFmldFsRN_Hx10GDvsdv1wroKq8r5Lzvjp6GZ4OO8c,88
|
|
18
|
+
tracktolib-0.48.1.dist-info/METADATA,sha256=HbP82J7Y04AIb7oBa1WGbgUSUXBCNfkFe7QeQQoBSQo,3610
|
|
19
|
+
tracktolib-0.48.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|