tilebox-storage 0.45.0__py3-none-any.whl → 0.47.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.
tilebox/storage/aio.py CHANGED
@@ -7,6 +7,7 @@ import zipfile
7
7
  from asyncio import Queue, QueueEmpty
8
8
  from collections.abc import AsyncIterator
9
9
  from pathlib import Path
10
+ from pathlib import PurePosixPath as ObjectPath
10
11
  from typing import Any, TypeAlias
11
12
 
12
13
  import anyio
@@ -29,7 +30,7 @@ from tilebox.storage.granule import (
29
30
  from tilebox.storage.providers import login
30
31
 
31
32
  try:
32
- from IPython.display import HTML, Image, display # type: ignore[assignment]
33
+ from IPython.display import HTML, Image, display
33
34
  except ImportError:
34
35
  # IPython is not available, so we can't display the quicklook image
35
36
  # but let's define stubs for the type checker
@@ -259,8 +260,8 @@ class StorageClient(Syncifiable):
259
260
 
260
261
  async def list_object_paths(store: ObjectStore, prefix: str) -> list[str]:
261
262
  objects = await obs.list(store, prefix).collect_async()
262
- prefix_path = Path(prefix)
263
- return sorted(str(Path(obj["path"]).relative_to(prefix_path)) for obj in objects)
263
+ prefix_path = ObjectPath(prefix)
264
+ return sorted(str(ObjectPath(obj["path"]).relative_to(prefix_path)) for obj in objects)
264
265
 
265
266
 
266
267
  async def download_objects( # noqa: PLR0913
@@ -299,7 +300,7 @@ async def _download_worker(
299
300
  async def _download_object(
300
301
  store: ObjectStore, prefix: str, obj: str, output_dir: Path, show_progress: bool = True
301
302
  ) -> Path:
302
- key = str(Path(prefix) / obj)
303
+ key = str(ObjectPath(prefix) / obj)
303
304
  output_path = output_dir / obj
304
305
  if output_path.exists(): # already cached
305
306
  return output_path
@@ -609,7 +610,7 @@ class CopernicusStorageClient(StorageClient):
609
610
  granule = CopernicusStorageGranule.from_data(datapoint)
610
611
  # special handling for Sentinel-5P, where the location is not a folder but a single file
611
612
  if granule.location.endswith(".nc"):
612
- return [Path(granule.granule_name).name]
613
+ return [str(ObjectPath(granule.granule_name))]
613
614
 
614
615
  return await list_object_paths(self._store, _copernicus_s3_prefix(granule))
615
616
 
@@ -1,6 +1,6 @@
1
1
  from dataclasses import dataclass
2
2
  from datetime import datetime
3
- from pathlib import Path
3
+ from pathlib import PurePosixPath as ObjectPath
4
4
 
5
5
  import xarray as xr
6
6
 
@@ -103,7 +103,7 @@ def _thumbnail_relative_to_eodata_location(thumbnail_url: str, location: str) ->
103
103
  url_path = thumbnail_url.split("?path=")[-1]
104
104
  url_path = url_path.removeprefix("/")
105
105
  location = location.removeprefix("/eodata/")
106
- return str(Path(url_path).relative_to(location))
106
+ return str(ObjectPath(url_path).relative_to(location))
107
107
 
108
108
 
109
109
  @dataclass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: tilebox-storage
3
- Version: 0.45.0
3
+ Version: 0.47.0
4
4
  Summary: Storage client for Tilebox
5
5
  Project-URL: Homepage, https://tilebox.com
6
6
  Project-URL: Documentation, https://docs.tilebox.com/
@@ -20,6 +20,7 @@ Classifier: Topic :: Scientific/Engineering
20
20
  Classifier: Topic :: Software Development
21
21
  Requires-Python: >=3.10
22
22
  Requires-Dist: aiofile>=3.8
23
+ Requires-Dist: boto3>=1.37.0
23
24
  Requires-Dist: folium>=0.15
24
25
  Requires-Dist: httpx>=0.27
25
26
  Requires-Dist: obstore>=0.8.0
@@ -0,0 +1,7 @@
1
+ tilebox/storage/__init__.py,sha256=nQYsEKee3lBCDi_rmISGd-kKgqDV75ogiadbpLKLGww,3290
2
+ tilebox/storage/aio.py,sha256=LA4mppLE58YXWqTdZ0JLg0CGWNUigz1YxakllJ7LWz0,38427
3
+ tilebox/storage/granule.py,sha256=RaWDHoQMtSbHQ3-7bgjKSFpSQImDDDzf2xAxLkNOTn4,6208
4
+ tilebox/storage/providers.py,sha256=vOTxSj2VIQhbFyvxu_eOcPmBGETDaijRoCWi9heUwRs,1832
5
+ tilebox_storage-0.47.0.dist-info/METADATA,sha256=X6e4_hviitgJtmfFRI_uqA4pnFzlCILH3svacNFx5Lg,4132
6
+ tilebox_storage-0.47.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
7
+ tilebox_storage-0.47.0.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: hatchling 1.27.0
2
+ Generator: hatchling 1.28.0
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
@@ -1,7 +0,0 @@
1
- tilebox/storage/__init__.py,sha256=nQYsEKee3lBCDi_rmISGd-kKgqDV75ogiadbpLKLGww,3290
2
- tilebox/storage/aio.py,sha256=kNahmyUUXeFMgA-XvBXq3MCqBkZw-8BPLr7n2HLf5gA,38383
3
- tilebox/storage/granule.py,sha256=RPw3UkiIwGwQEqmiuxy2tbWAMrjoMYNNigXimB4jJGI,6179
4
- tilebox/storage/providers.py,sha256=vOTxSj2VIQhbFyvxu_eOcPmBGETDaijRoCWi9heUwRs,1832
5
- tilebox_storage-0.45.0.dist-info/METADATA,sha256=1B9myKhpqMpEJTRpN5tsRPeZ8ig5CpIGaFyuXPSobF8,4103
6
- tilebox_storage-0.45.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
7
- tilebox_storage-0.45.0.dist-info/RECORD,,