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.

Files changed (58) hide show
  1. {datacosmos-0.0.9 → datacosmos-0.0.11}/PKG-INFO +1 -1
  2. datacosmos-0.0.11/datacosmos/config/models/url.py +54 -0
  3. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/enums/processing_level.py +8 -7
  4. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/storage/dataclasses/upload_path.py +1 -1
  5. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos.egg-info/PKG-INFO +1 -1
  6. {datacosmos-0.0.9 → datacosmos-0.0.11}/pyproject.toml +1 -1
  7. datacosmos-0.0.9/datacosmos/config/models/url.py +0 -35
  8. {datacosmos-0.0.9 → datacosmos-0.0.11}/LICENSE.md +0 -0
  9. {datacosmos-0.0.9 → datacosmos-0.0.11}/README.md +0 -0
  10. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/__init__.py +0 -0
  11. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/__init__.py +0 -0
  12. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/config.py +0 -0
  13. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/models/__init__.py +0 -0
  14. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/models/authentication_config.py +0 -0
  15. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/models/local_user_account_authentication_config.py +0 -0
  16. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/models/m2m_authentication_config.py +0 -0
  17. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/config/models/no_authentication_config.py +0 -0
  18. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/datacosmos_client.py +0 -0
  19. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/exceptions/__init__.py +0 -0
  20. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/exceptions/datacosmos_exception.py +0 -0
  21. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/__init__.py +0 -0
  22. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/collection/__init__.py +0 -0
  23. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/collection/collection_client.py +0 -0
  24. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/collection/models/__init__.py +0 -0
  25. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/collection/models/collection_update.py +0 -0
  26. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/constants/__init__.py +0 -0
  27. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/constants/satellite_name_mapping.py +0 -0
  28. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/enums/__init__.py +0 -0
  29. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/enums/product_type.py +0 -0
  30. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/enums/season.py +0 -0
  31. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/__init__.py +0 -0
  32. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/item_client.py +0 -0
  33. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/__init__.py +0 -0
  34. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/asset.py +0 -0
  35. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/catalog_search_parameters.py +0 -0
  36. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/datacosmos_item.py +0 -0
  37. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/eo_band.py +0 -0
  38. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/item_update.py +0 -0
  39. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/item/models/raster_band.py +0 -0
  40. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/stac_client.py +0 -0
  41. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/storage/__init__.py +0 -0
  42. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/storage/dataclasses/__init__.py +0 -0
  43. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/storage/storage_base.py +0 -0
  44. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/storage/storage_client.py +0 -0
  45. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/stac/storage/uploader.py +0 -0
  46. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/__init__.py +0 -0
  47. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/http_response/__init__.py +0 -0
  48. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/http_response/check_api_response.py +0 -0
  49. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/http_response/models/__init__.py +0 -0
  50. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/http_response/models/datacosmos_error.py +0 -0
  51. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/http_response/models/datacosmos_response.py +0 -0
  52. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos/utils/url.py +0 -0
  53. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos.egg-info/SOURCES.txt +0 -0
  54. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos.egg-info/dependency_links.txt +0 -0
  55. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos.egg-info/requires.txt +0 -0
  56. {datacosmos-0.0.9 → datacosmos-0.0.11}/datacosmos.egg-info/top_level.txt +0 -0
  57. {datacosmos-0.0.9 → datacosmos-0.0.11}/setup.cfg +0 -0
  58. {datacosmos-0.0.9 → datacosmos-0.0.11}/tests/test_pass.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datacosmos
3
- Version: 0.0.9
3
+ Version: 0.0.11
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
@@ -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
- L0 = "L0"
10
- L1A = "L1A"
11
- L2A = "L2A"
12
- L1B = "L1B"
13
- L1C = "L1C"
14
- L1D = "L1D"
15
- L3 = "L3"
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"].upper()),
40
+ level=ProcessingLevel(item.properties["processing:level"]),
41
41
  day=dt.day,
42
42
  month=dt.month,
43
43
  year=dt.year,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datacosmos
3
- Version: 0.0.9
3
+ Version: 0.0.11
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "datacosmos"
7
- version = "0.0.9"
7
+ version = "0.0.11"
8
8
  authors = [
9
9
  { name="Open Cosmos", email="support@open-cosmos.com" },
10
10
  ]
@@ -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