datacosmos 0.0.14__tar.gz → 0.0.15__tar.gz
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 datacosmos might be problematic. Click here for more details.
- {datacosmos-0.0.14 → datacosmos-0.0.15}/PKG-INFO +2 -1
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/datacosmos_client.py +12 -9
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos.egg-info/PKG-INFO +2 -1
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos.egg-info/requires.txt +1 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/pyproject.toml +4 -3
- {datacosmos-0.0.14 → datacosmos-0.0.15}/LICENSE.md +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/README.md +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/auth/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/auth/local_token_fetcher.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/auth/token.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/auth/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/auth/factory.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/config.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/constants.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/loaders/yaml_source.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/models/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/models/authentication_config.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/models/local_user_account_authentication_config.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/models/m2m_authentication_config.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/models/no_authentication_config.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/models/url.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/exceptions/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/exceptions/datacosmos_exception.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/collection/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/collection/collection_client.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/collection/models/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/collection/models/collection_update.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/constants/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/constants/satellite_name_mapping.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/enums/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/enums/processing_level.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/enums/product_type.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/enums/season.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/item/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/item/item_client.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/item/models/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/item/models/asset.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/item/models/catalog_search_parameters.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/item/models/datacosmos_item.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/item/models/eo_band.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/item/models/item_update.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/item/models/raster_band.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/stac_client.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/storage/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/storage/dataclasses/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/storage/dataclasses/upload_path.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/storage/storage_base.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/storage/storage_client.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/storage/uploader.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/utils/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/utils/http_response/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/utils/http_response/check_api_response.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/utils/http_response/models/__init__.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/utils/http_response/models/datacosmos_error.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/utils/http_response/models/datacosmos_response.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/utils/url.py +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos.egg-info/SOURCES.txt +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos.egg-info/dependency_links.txt +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos.egg-info/top_level.txt +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/setup.cfg +0 -0
- {datacosmos-0.0.14 → datacosmos-0.0.15}/tests/test_pass.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datacosmos
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.15
|
|
4
4
|
Summary: A library for interacting with DataCosmos from Python code
|
|
5
5
|
Author-email: Open Cosmos <support@open-cosmos.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -15,6 +15,7 @@ Requires-Dist: pydantic>=2
|
|
|
15
15
|
Requires-Dist: pystac==1.12.1
|
|
16
16
|
Requires-Dist: pyyaml==6.0.2
|
|
17
17
|
Requires-Dist: structlog==24.4.0
|
|
18
|
+
Requires-Dist: tenacity>=8.2.3
|
|
18
19
|
Provides-Extra: dev
|
|
19
20
|
Requires-Dist: black==22.3.0; extra == "dev"
|
|
20
21
|
Requires-Dist: ruff==0.9.5; extra == "dev"
|
|
@@ -9,6 +9,12 @@ import requests
|
|
|
9
9
|
from oauthlib.oauth2 import BackendApplicationClient
|
|
10
10
|
from requests.exceptions import ConnectionError, HTTPError, RequestException, Timeout
|
|
11
11
|
from requests_oauthlib import OAuth2Session
|
|
12
|
+
from tenacity import (
|
|
13
|
+
retry,
|
|
14
|
+
retry_if_exception_type,
|
|
15
|
+
stop_after_attempt,
|
|
16
|
+
wait_exponential,
|
|
17
|
+
)
|
|
12
18
|
|
|
13
19
|
from datacosmos.config.config import Config
|
|
14
20
|
from datacosmos.exceptions.datacosmos_exception import DatacosmosException
|
|
@@ -215,10 +221,15 @@ class DatacosmosClient:
|
|
|
215
221
|
|
|
216
222
|
# --------------------------- request API ---------------------------
|
|
217
223
|
|
|
224
|
+
@retry(
|
|
225
|
+
stop=stop_after_attempt(5),
|
|
226
|
+
wait=wait_exponential(multiplier=1, min=2, max=20),
|
|
227
|
+
retry=retry_if_exception_type((ConnectionError, Timeout)),
|
|
228
|
+
)
|
|
218
229
|
def request(
|
|
219
230
|
self, method: str, url: str, *args: Any, **kwargs: Any
|
|
220
231
|
) -> requests.Response:
|
|
221
|
-
"""Send an HTTP request using the authenticated session (with auto-refresh)."""
|
|
232
|
+
"""Send an HTTP request using the authenticated session (with auto-refresh and retries)."""
|
|
222
233
|
self._refresh_token_if_needed()
|
|
223
234
|
try:
|
|
224
235
|
response = self._http_client.request(method, url, *args, **kwargs)
|
|
@@ -242,14 +253,6 @@ class DatacosmosClient:
|
|
|
242
253
|
f"HTTP error during {method.upper()} request to {url}",
|
|
243
254
|
response=getattr(e, "response", None),
|
|
244
255
|
) from e
|
|
245
|
-
except ConnectionError as e:
|
|
246
|
-
raise DatacosmosException(
|
|
247
|
-
f"Connection error during {method.upper()} request to {url}: {e}"
|
|
248
|
-
) from e
|
|
249
|
-
except Timeout as e:
|
|
250
|
-
raise DatacosmosException(
|
|
251
|
-
f"Request timeout during {method.upper()} request to {url}: {e}"
|
|
252
|
-
) from e
|
|
253
256
|
except RequestException as e:
|
|
254
257
|
raise DatacosmosException(
|
|
255
258
|
f"Unexpected request failure during {method.upper()} request to {url}: {e}"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: datacosmos
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.15
|
|
4
4
|
Summary: A library for interacting with DataCosmos from Python code
|
|
5
5
|
Author-email: Open Cosmos <support@open-cosmos.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -15,6 +15,7 @@ Requires-Dist: pydantic>=2
|
|
|
15
15
|
Requires-Dist: pystac==1.12.1
|
|
16
16
|
Requires-Dist: pyyaml==6.0.2
|
|
17
17
|
Requires-Dist: structlog==24.4.0
|
|
18
|
+
Requires-Dist: tenacity>=8.2.3
|
|
18
19
|
Provides-Extra: dev
|
|
19
20
|
Requires-Dist: black==22.3.0; extra == "dev"
|
|
20
21
|
Requires-Dist: ruff==0.9.5; extra == "dev"
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "datacosmos"
|
|
7
|
-
version = "0.0.
|
|
7
|
+
version = "0.0.15"
|
|
8
8
|
authors = [
|
|
9
9
|
{ name="Open Cosmos", email="support@open-cosmos.com" },
|
|
10
10
|
]
|
|
@@ -22,7 +22,8 @@ dependencies = [
|
|
|
22
22
|
"pydantic>=2",
|
|
23
23
|
"pystac==1.12.1",
|
|
24
24
|
"pyyaml==6.0.2",
|
|
25
|
-
"structlog==24.4.0"
|
|
25
|
+
"structlog==24.4.0",
|
|
26
|
+
"tenacity>=8.2.3"
|
|
26
27
|
]
|
|
27
28
|
|
|
28
29
|
[project.optional-dependencies]
|
|
@@ -51,4 +52,4 @@ multi_line_output = 3
|
|
|
51
52
|
include_trailing_comma = true
|
|
52
53
|
force_grid_wrap = 0
|
|
53
54
|
use_parentheses = true
|
|
54
|
-
line_length = 88
|
|
55
|
+
line_length = 88
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/models/m2m_authentication_config.py
RENAMED
|
File without changes
|
{datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/config/models/no_authentication_config.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/collection/models/collection_update.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/stac/item/models/catalog_search_parameters.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/utils/http_response/check_api_response.py
RENAMED
|
File without changes
|
|
File without changes
|
{datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/utils/http_response/models/datacosmos_error.py
RENAMED
|
File without changes
|
{datacosmos-0.0.14 → datacosmos-0.0.15}/datacosmos/utils/http_response/models/datacosmos_response.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|