datacosmos 0.0.9__tar.gz → 0.0.11__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.9 → datacosmos-0.0.11}/PKG-INFO +1 -1
- datacosmos-0.0.11/datacosmos/config/models/url.py +54 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/enums/processing_level.py +8 -7
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/storage/dataclasses/upload_path.py +1 -1
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos.egg-info/PKG-INFO +1 -1
- {datacosmos-0.0.9 → datacosmos-0.0.11}/pyproject.toml +1 -1
- datacosmos-0.0.9/datacosmos/config/models/url.py +0 -35
- {datacosmos-0.0.9 → datacosmos-0.0.11}/LICENSE.md +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/README.md +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/config.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/models/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/models/authentication_config.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/models/local_user_account_authentication_config.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/models/m2m_authentication_config.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/models/no_authentication_config.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/datacosmos_client.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/exceptions/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/exceptions/datacosmos_exception.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/collection/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/collection/collection_client.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/collection/models/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/collection/models/collection_update.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/constants/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/constants/satellite_name_mapping.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/enums/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/enums/product_type.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/enums/season.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/item_client.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/asset.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/catalog_search_parameters.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/datacosmos_item.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/eo_band.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/item_update.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/raster_band.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/stac_client.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/storage/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/storage/dataclasses/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/storage/storage_base.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/storage/storage_client.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/storage/uploader.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/http_response/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/http_response/check_api_response.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/http_response/models/__init__.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/http_response/models/datacosmos_error.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/http_response/models/datacosmos_response.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/url.py +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos.egg-info/SOURCES.txt +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos.egg-info/dependency_links.txt +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos.egg-info/requires.txt +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos.egg-info/top_level.txt +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/setup.cfg +0 -0
- {datacosmos-0.0.9 → datacosmos-0.0.11}/tests/test_pass.py +0 -0
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"""Structured URL configuration model for the Datacosmos SDK.
|
|
2
|
+
|
|
3
|
+
The model accepts *either* a mapping of fields
|
|
4
|
+
(protocol, host, port, path) **or** a raw URL string such as
|
|
5
|
+
``"https://example.com/api/v1"`` and converts it into a fully featured
|
|
6
|
+
:class:`datacosmos.utils.url.URL` instance via :py:meth:`as_domain_url`.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from urllib.parse import urlparse
|
|
10
|
+
|
|
11
|
+
from pydantic import BaseModel, model_validator
|
|
12
|
+
|
|
13
|
+
from datacosmos.utils.url import URL as DomainURL
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class URL(BaseModel):
|
|
17
|
+
"""Generic configuration model for a URL."""
|
|
18
|
+
|
|
19
|
+
protocol: str
|
|
20
|
+
host: str
|
|
21
|
+
port: int
|
|
22
|
+
path: str
|
|
23
|
+
|
|
24
|
+
@model_validator(mode="before")
|
|
25
|
+
@classmethod
|
|
26
|
+
def _coerce_from_string(cls, data):
|
|
27
|
+
"""Convert a raw URL string into the dict expected by the model."""
|
|
28
|
+
if isinstance(data, cls):
|
|
29
|
+
return data
|
|
30
|
+
|
|
31
|
+
if isinstance(data, str):
|
|
32
|
+
parts = urlparse(data)
|
|
33
|
+
if not parts.scheme or not parts.hostname:
|
|
34
|
+
raise ValueError(f"'{data}' is not a valid absolute URL")
|
|
35
|
+
|
|
36
|
+
default_port = 443 if parts.scheme == "https" else 80
|
|
37
|
+
|
|
38
|
+
return {
|
|
39
|
+
"protocol": parts.scheme,
|
|
40
|
+
"host": parts.hostname,
|
|
41
|
+
"port": parts.port or default_port,
|
|
42
|
+
"path": parts.path.rstrip("/"),
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return data
|
|
46
|
+
|
|
47
|
+
def as_domain_url(self) -> DomainURL:
|
|
48
|
+
"""Convert this Pydantic model to the utility `DomainURL` object."""
|
|
49
|
+
return DomainURL(
|
|
50
|
+
protocol=self.protocol,
|
|
51
|
+
host=self.host,
|
|
52
|
+
port=self.port,
|
|
53
|
+
base=self.path,
|
|
54
|
+
)
|
|
@@ -6,10 +6,11 @@ from enum import Enum
|
|
|
6
6
|
class ProcessingLevel(Enum):
|
|
7
7
|
"""Enum class for the processing levels of the data."""
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
RAW = "RAW"
|
|
10
|
+
L0 = "l0"
|
|
11
|
+
L1A = "l1A"
|
|
12
|
+
L2A = "l2A"
|
|
13
|
+
L1B = "l1B"
|
|
14
|
+
L1C = "l1C"
|
|
15
|
+
L1D = "l1D"
|
|
16
|
+
L3 = "l3"
|
|
@@ -37,7 +37,7 @@ class UploadPath:
|
|
|
37
37
|
dt = datetime.strptime(item.properties["datetime"], "%Y-%m-%dT%H:%M:%SZ")
|
|
38
38
|
path = UploadPath(
|
|
39
39
|
mission=mission,
|
|
40
|
-
level=ProcessingLevel(item.properties["processing:level"]
|
|
40
|
+
level=ProcessingLevel(item.properties["processing:level"]),
|
|
41
41
|
day=dt.day,
|
|
42
42
|
month=dt.month,
|
|
43
43
|
year=dt.year,
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
"""Module defining a structured URL configuration model.
|
|
2
|
-
|
|
3
|
-
Ensures that URLs contain required components such as protocol, host,
|
|
4
|
-
port, and path.
|
|
5
|
-
"""
|
|
6
|
-
|
|
7
|
-
from pydantic import BaseModel
|
|
8
|
-
|
|
9
|
-
from datacosmos.utils.url import URL as DomainURL
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class URL(BaseModel):
|
|
13
|
-
"""Generic configuration model for a URL.
|
|
14
|
-
|
|
15
|
-
This class provides attributes to store URL components and a method
|
|
16
|
-
to convert them into a `DomainURL` instance.
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
protocol: str
|
|
20
|
-
host: str
|
|
21
|
-
port: int
|
|
22
|
-
path: str
|
|
23
|
-
|
|
24
|
-
def as_domain_url(self) -> DomainURL:
|
|
25
|
-
"""Convert the URL instance to a `DomainURL` object.
|
|
26
|
-
|
|
27
|
-
Returns:
|
|
28
|
-
DomainURL: A domain-specific URL object.
|
|
29
|
-
"""
|
|
30
|
-
return DomainURL(
|
|
31
|
-
protocol=self.protocol,
|
|
32
|
-
host=self.host,
|
|
33
|
-
port=self.port,
|
|
34
|
-
base=self.path,
|
|
35
|
-
)
|
|
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.9 → datacosmos-0.0.11}/datacosmos/config/models/m2m_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
|
|
File without changes
|
{datacosmos-0.0.9 → datacosmos-0.0.11}/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
|
{datacosmos-0.0.9 → datacosmos-0.0.11}/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
|
|
File without changes
|
{datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/http_response/models/datacosmos_error.py
RENAMED
|
File without changes
|
{datacosmos-0.0.9 → datacosmos-0.0.11}/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
|
|
File without changes
|