thds.adls 3.1.20250227181712__py3-none-any.whl → 3.1.20250227212149__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/cached_up_down.py +22 -0
- {thds_adls-3.1.20250227181712.dist-info → thds_adls-3.1.20250227212149.dist-info}/METADATA +6 -3
- {thds_adls-3.1.20250227181712.dist-info → thds_adls-3.1.20250227212149.dist-info}/RECORD +6 -7
- thds/adls/meta.json +0 -8
- {thds_adls-3.1.20250227181712.dist-info → thds_adls-3.1.20250227212149.dist-info}/WHEEL +0 -0
- {thds_adls-3.1.20250227181712.dist-info → thds_adls-3.1.20250227212149.dist-info}/entry_points.txt +0 -0
- {thds_adls-3.1.20250227181712.dist-info → thds_adls-3.1.20250227212149.dist-info}/top_level.txt +0 -0
thds/adls/cached_up_down.py
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import typing as ty
|
|
1
2
|
from pathlib import Path
|
|
2
3
|
|
|
4
|
+
from thds.adls import source
|
|
5
|
+
from thds.core.source import Source
|
|
6
|
+
from thds.core.source.tree import SourceTree
|
|
7
|
+
|
|
3
8
|
from .download import download_or_use_verified
|
|
4
9
|
from .fqn import AdlsFqn
|
|
5
10
|
from .global_client import get_global_fs_client
|
|
@@ -46,3 +51,20 @@ def download_directory(fqn: AdlsFqn) -> Path:
|
|
|
46
51
|
fs.fetch_directory(fqn.path, cached_dir_root)
|
|
47
52
|
assert cached_dir_root.is_dir(), "Directory should have been downloaded to the cache."
|
|
48
53
|
return cached_dir_root
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def upload_directory_through_cache(dest: UriIsh, src_path: Path) -> SourceTree:
|
|
57
|
+
if not src_path.is_dir():
|
|
58
|
+
raise ValueError(f"If you want to upload a file, use {upload_through_cache.__name__} instead")
|
|
59
|
+
|
|
60
|
+
dest = parse_any(dest)
|
|
61
|
+
|
|
62
|
+
def _upload_directory(dir_path: Path) -> ty.Iterable[Source]:
|
|
63
|
+
for item in dir_path.iterdir():
|
|
64
|
+
if item.is_dir(): # recur
|
|
65
|
+
yield from _upload_directory(item)
|
|
66
|
+
elif item.is_file(): # upload
|
|
67
|
+
file_dest = dest / str(item.relative_to(src_path))
|
|
68
|
+
yield source.from_adls(upload_through_cache(file_dest, item))
|
|
69
|
+
|
|
70
|
+
return SourceTree(sources=list(_upload_directory(src_path)))
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: thds.adls
|
|
3
|
-
Version: 3.1.
|
|
3
|
+
Version: 3.1.20250227212149
|
|
4
4
|
Summary: ADLS tools
|
|
5
|
-
Author: Trilliant Health
|
|
5
|
+
Author-email: Trilliant Health <info@trillianthealth.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Repository, https://github.com/TrilliantHealth/trilliant-data-science
|
|
8
|
+
Requires-Python: >=3.8
|
|
6
9
|
Description-Content-Type: text/markdown
|
|
7
10
|
Requires-Dist: aiohttp>=3.8.1
|
|
8
11
|
Requires-Dist: aiostream>=0.4.5
|
|
9
12
|
Requires-Dist: azure-identity>=1.9
|
|
10
13
|
Requires-Dist: azure-storage-file-datalake>=12.6
|
|
11
14
|
Requires-Dist: filelock>=3.0
|
|
12
|
-
Requires-Dist: thds
|
|
15
|
+
Requires-Dist: thds-core
|
|
13
16
|
|
|
14
17
|
# adls Library
|
|
15
18
|
|
|
@@ -2,7 +2,7 @@ thds/adls/__init__.py,sha256=er14MoCC9PlJMxWVS4G1hAeMJItaJj4EAsrTZlvlb0M,797
|
|
|
2
2
|
thds/adls/_progress.py,sha256=ZzCHn_G7nHakioNFxdvoJZRr-jN6ymsp5JXf-iReROM,6580
|
|
3
3
|
thds/adls/_upload.py,sha256=q6Sk0CRnNcAjUOUPiBj4CfO4tJD196SQY0lT25CTSE4,4364
|
|
4
4
|
thds/adls/abfss.py,sha256=ZRJOLjDuXmS4bIbQAQpQxWWWeu74N9NKEKCNfXQek80,726
|
|
5
|
-
thds/adls/cached_up_down.py,sha256=
|
|
5
|
+
thds/adls/cached_up_down.py,sha256=CEqg-Q9FB_fvgCsN0C_dn9CJqnEpnF0lA7gCdd9s6gg,2721
|
|
6
6
|
thds/adls/conf.py,sha256=q1SPrgb46NpobVzwt_Oyv71-BvsIbZLq9nRWS3LZjz0,1990
|
|
7
7
|
thds/adls/copy.py,sha256=jUWbGvTpb4B3yRGS0nhGSbDzqRPzUqYgH0z1lFRJB3k,6365
|
|
8
8
|
thds/adls/dbfs.py,sha256=pPAjbIZRKJsaXKQljDMUgqS_zy1yKeEZHGMueXbuv3g,2219
|
|
@@ -16,7 +16,6 @@ thds/adls/fqn.py,sha256=0zHmHhBWN7GEfKRB3fBC1NVhaiIHHifBdCRanyT01X8,5822
|
|
|
16
16
|
thds/adls/global_client.py,sha256=f4VJw5y_Yh__8gQUcdSYTh1aU6iEPlauMchVirSAwDQ,3716
|
|
17
17
|
thds/adls/impl.py,sha256=x1nSqc8W4NeuX8-JGOp2MRkK8ff6GnelTWedGxPs-qY,42494
|
|
18
18
|
thds/adls/md5.py,sha256=qOX4_7WUj1QkbH_IwREcQNHvvZccOj-HpHZBfsKn1gY,1846
|
|
19
|
-
thds/adls/meta.json,sha256=MhZqsLGrHq1cqZB6OydUf5yDbfo_GySrRRtjdpImBQc,195
|
|
20
19
|
thds/adls/named_roots.py,sha256=7SLbAoQQpV_mrFZaUPjYoS-F9dxQxN5Hg4M3YPirF_w,751
|
|
21
20
|
thds/adls/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
21
|
thds/adls/ro_cache.py,sha256=F0uXol0t95mcRuBukNg3A7wt7XXQxpD5Sy09d9sl8f0,4825
|
|
@@ -34,8 +33,8 @@ thds/adls/resource/up_down.py,sha256=3uNlTvm2gVhSyYdQTBwsGecOgwtINQfINckR-awwV0Y
|
|
|
34
33
|
thds/adls/tools/download.py,sha256=vvBO8lSDl9oPugv75qpCkoemT9pOM9BV6yeExlkyG08,1594
|
|
35
34
|
thds/adls/tools/ls.py,sha256=OgEaIfTK359twlZIj-A0AW_nv81Z6zi0b9Tw6OJJfWA,1083
|
|
36
35
|
thds/adls/tools/upload.py,sha256=eMk4pdug1aCMPDDWpIE3Zoq77i5APp9Uuh-sVCCDNJE,493
|
|
37
|
-
thds_adls-3.1.
|
|
38
|
-
thds_adls-3.1.
|
|
39
|
-
thds_adls-3.1.
|
|
40
|
-
thds_adls-3.1.
|
|
41
|
-
thds_adls-3.1.
|
|
36
|
+
thds_adls-3.1.20250227212149.dist-info/METADATA,sha256=6yWUfyCWoC9_C_HYmalt1Wyux_QLfRUP-hP7euqkciM,543
|
|
37
|
+
thds_adls-3.1.20250227212149.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
|
|
38
|
+
thds_adls-3.1.20250227212149.dist-info/entry_points.txt,sha256=uTqreT1AIwqJboMfLv5w6sviM8mNbAkln765gIjzoA4,152
|
|
39
|
+
thds_adls-3.1.20250227212149.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
|
|
40
|
+
thds_adls-3.1.20250227212149.dist-info/RECORD,,
|
thds/adls/meta.json
DELETED
|
File without changes
|
{thds_adls-3.1.20250227181712.dist-info → thds_adls-3.1.20250227212149.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{thds_adls-3.1.20250227181712.dist-info → thds_adls-3.1.20250227212149.dist-info}/top_level.txt
RENAMED
|
File without changes
|