thds.adls 3.2.20250429183934__py3-none-any.whl → 3.2.20250430190213__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 thds.adls might be problematic. Click here for more details.
- thds/adls/source_tree.py +16 -12
- {thds_adls-3.2.20250429183934.dist-info → thds_adls-3.2.20250430190213.dist-info}/METADATA +1 -1
- {thds_adls-3.2.20250429183934.dist-info → thds_adls-3.2.20250430190213.dist-info}/RECORD +6 -6
- {thds_adls-3.2.20250429183934.dist-info → thds_adls-3.2.20250430190213.dist-info}/WHEEL +1 -1
- {thds_adls-3.2.20250429183934.dist-info → thds_adls-3.2.20250430190213.dist-info}/entry_points.txt +0 -0
- {thds_adls-3.2.20250429183934.dist-info → thds_adls-3.2.20250430190213.dist-info}/top_level.txt +0 -0
thds/adls/source_tree.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import typing as ty
|
|
2
2
|
from dataclasses import dataclass
|
|
3
3
|
|
|
4
|
-
from azure.storage.blob import ContainerClient
|
|
4
|
+
from azure.storage.blob import BlobProperties, ContainerClient
|
|
5
5
|
|
|
6
6
|
from thds.core import hashing
|
|
7
7
|
from thds.core.source.tree import SourceTree
|
|
@@ -16,6 +16,18 @@ class BlobMeta:
|
|
|
16
16
|
md5: ty.Optional[hashing.Hash]
|
|
17
17
|
|
|
18
18
|
|
|
19
|
+
def to_blob_meta(blob_props: BlobProperties) -> BlobMeta:
|
|
20
|
+
return BlobMeta(
|
|
21
|
+
blob_props.name,
|
|
22
|
+
blob_props.size,
|
|
23
|
+
(
|
|
24
|
+
hashing.Hash("md5", bytes(blob_props.content_settings.content_md5))
|
|
25
|
+
if blob_props.content_settings.content_md5
|
|
26
|
+
else None
|
|
27
|
+
),
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
19
31
|
# https://learn.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.containerclient?view=azure-python#azure-storage-blob-containerclient-list-blobs
|
|
20
32
|
# https://learn.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.blobproperties?view=azure-python
|
|
21
33
|
# https://learn.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.contentsettings?view=azure-python
|
|
@@ -24,19 +36,11 @@ def list_blob_meta(
|
|
|
24
36
|
) -> ty.List[BlobMeta]:
|
|
25
37
|
"""Gets the path (relative to the SA/container root), size, and MD5 hash of all blobs in a directory."""
|
|
26
38
|
return [
|
|
27
|
-
|
|
28
|
-
blob_props.name, # type: ignore
|
|
29
|
-
blob_props.size, # type: ignore
|
|
30
|
-
(
|
|
31
|
-
hashing.Hash("md5", bytes(blob_props.content_settings.content_md5))
|
|
32
|
-
if blob_props.content_settings.content_md5
|
|
33
|
-
else None
|
|
34
|
-
),
|
|
35
|
-
)
|
|
39
|
+
to_blob_meta(blob_props)
|
|
36
40
|
for blob_props in container_client.list_blobs(name_starts_with=root_dir)
|
|
37
|
-
if blob_props.size > 0
|
|
41
|
+
if blob_props.size > 0
|
|
38
42
|
# container client lists directories as blobs with size 0
|
|
39
|
-
and blob_props.name.endswith(match_suffix)
|
|
43
|
+
and blob_props.name.endswith(match_suffix)
|
|
40
44
|
]
|
|
41
45
|
|
|
42
46
|
|
|
@@ -22,7 +22,7 @@ thds/adls/ro_cache.py,sha256=F0uXol0t95mcRuBukNg3A7wt7XXQxpD5Sy09d9sl8f0,4825
|
|
|
22
22
|
thds/adls/sas_tokens.py,sha256=mArbB_GYohevOmArw_1gKqVUWpv6kG8Hsbvdrhbtnbg,1957
|
|
23
23
|
thds/adls/shared_credential.py,sha256=-x42aXoIM001KW59oS8PpuXQd4-F2vg-1gB6OMHlpk4,4602
|
|
24
24
|
thds/adls/source.py,sha256=1JYliDqafqpLewOQ2XMKp4T2WD7b5Rl7XYViyLYtzX8,2437
|
|
25
|
-
thds/adls/source_tree.py,sha256=
|
|
25
|
+
thds/adls/source_tree.py,sha256=yP_v2XrKxXqUOdZ-x8kqHhBFAuur3AlAq3zi4hHj4AE,2235
|
|
26
26
|
thds/adls/uri.py,sha256=pDH956p_VEHnjLLUnjWY6sGgRqksp9gdpc9KOW4gEP0,1205
|
|
27
27
|
thds/adls/azcopy/__init__.py,sha256=nTNbgz2GcEiGeswYbAgy4oPhivnzl_5crF3HqCdWWiw,31
|
|
28
28
|
thds/adls/azcopy/download.py,sha256=Fig6q-bRZBeoA5L-URl5BACfMH9-9_sc4T2sa9yiZyQ,6611
|
|
@@ -33,8 +33,8 @@ thds/adls/resource/up_down.py,sha256=3uNlTvm2gVhSyYdQTBwsGecOgwtINQfINckR-awwV0Y
|
|
|
33
33
|
thds/adls/tools/download.py,sha256=vvBO8lSDl9oPugv75qpCkoemT9pOM9BV6yeExlkyG08,1594
|
|
34
34
|
thds/adls/tools/ls.py,sha256=OgEaIfTK359twlZIj-A0AW_nv81Z6zi0b9Tw6OJJfWA,1083
|
|
35
35
|
thds/adls/tools/upload.py,sha256=eMk4pdug1aCMPDDWpIE3Zoq77i5APp9Uuh-sVCCDNJE,493
|
|
36
|
-
thds_adls-3.2.
|
|
37
|
-
thds_adls-3.2.
|
|
38
|
-
thds_adls-3.2.
|
|
39
|
-
thds_adls-3.2.
|
|
40
|
-
thds_adls-3.2.
|
|
36
|
+
thds_adls-3.2.20250430190213.dist-info/METADATA,sha256=Kqsb0HYnt8kOCucg5FKlyCuKY8gJPNT5tDQ1f9ul0mI,543
|
|
37
|
+
thds_adls-3.2.20250430190213.dist-info/WHEEL,sha256=wXxTzcEDnjrTwFYjLPcsW_7_XihufBwmpiBeiXNBGEA,91
|
|
38
|
+
thds_adls-3.2.20250430190213.dist-info/entry_points.txt,sha256=uTqreT1AIwqJboMfLv5w6sviM8mNbAkln765gIjzoA4,152
|
|
39
|
+
thds_adls-3.2.20250430190213.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
|
|
40
|
+
thds_adls-3.2.20250430190213.dist-info/RECORD,,
|
{thds_adls-3.2.20250429183934.dist-info → thds_adls-3.2.20250430190213.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{thds_adls-3.2.20250429183934.dist-info → thds_adls-3.2.20250430190213.dist-info}/top_level.txt
RENAMED
|
File without changes
|