datacosmos 0.0.5__tar.gz → 0.0.7__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 (57) hide show
  1. {datacosmos-0.0.5/datacosmos.egg-info → datacosmos-0.0.7}/PKG-INFO +4 -4
  2. {datacosmos-0.0.5 → datacosmos-0.0.7}/README.md +2 -3
  3. {datacosmos-0.0.5 → datacosmos-0.0.7/datacosmos}/config/config.py +11 -11
  4. datacosmos-0.0.7/datacosmos/config/models/authentication_config.py +15 -0
  5. datacosmos-0.0.7/datacosmos/config/models/local_user_account_authentication_config.py +26 -0
  6. datacosmos-0.0.7/datacosmos/config/models/no_authentication_config.py +17 -0
  7. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/datacosmos_client.py +1 -1
  8. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/uploader/datacosmos_uploader.py +1 -1
  9. {datacosmos-0.0.5 → datacosmos-0.0.7/datacosmos.egg-info}/PKG-INFO +4 -4
  10. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos.egg-info/SOURCES.txt +8 -5
  11. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos.egg-info/requires.txt +3 -3
  12. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos.egg-info/top_level.txt +0 -1
  13. {datacosmos-0.0.5 → datacosmos-0.0.7}/pyproject.toml +5 -5
  14. {datacosmos-0.0.5 → datacosmos-0.0.7}/LICENSE.md +0 -0
  15. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/__init__.py +0 -0
  16. {datacosmos-0.0.5 → datacosmos-0.0.7/datacosmos}/config/__init__.py +0 -0
  17. {datacosmos-0.0.5 → datacosmos-0.0.7/datacosmos}/config/models/__init__.py +0 -0
  18. {datacosmos-0.0.5 → datacosmos-0.0.7/datacosmos}/config/models/m2m_authentication_config.py +0 -0
  19. {datacosmos-0.0.5 → datacosmos-0.0.7/datacosmos}/config/models/url.py +0 -0
  20. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/exceptions/__init__.py +0 -0
  21. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/exceptions/datacosmos_exception.py +0 -0
  22. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/__init__.py +0 -0
  23. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/collection/__init__.py +0 -0
  24. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/collection/collection_client.py +0 -0
  25. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/collection/models/__init__.py +0 -0
  26. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/collection/models/collection_update.py +0 -0
  27. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/constants/__init__.py +0 -0
  28. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/constants/satellite_name_mapping.py +0 -0
  29. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/enums/__init__.py +0 -0
  30. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/enums/processing_level.py +0 -0
  31. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/enums/product_type.py +0 -0
  32. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/enums/season.py +0 -0
  33. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/item/__init__.py +0 -0
  34. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/item/item_client.py +0 -0
  35. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/item/models/__init__.py +0 -0
  36. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/item/models/asset.py +0 -0
  37. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/item/models/catalog_search_parameters.py +0 -0
  38. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/item/models/datacosmos_item.py +0 -0
  39. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/item/models/eo_band.py +0 -0
  40. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/item/models/item_update.py +0 -0
  41. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/item/models/raster_band.py +0 -0
  42. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/stac/stac_client.py +0 -0
  43. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/uploader/__init__.py +0 -0
  44. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/uploader/dataclasses/__init__.py +0 -0
  45. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/uploader/dataclasses/upload_path.py +0 -0
  46. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/utils/__init__.py +0 -0
  47. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/utils/constants.py +0 -0
  48. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/utils/http_response/__init__.py +0 -0
  49. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/utils/http_response/check_api_response.py +0 -0
  50. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/utils/http_response/models/__init__.py +0 -0
  51. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/utils/http_response/models/datacosmos_error.py +0 -0
  52. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/utils/http_response/models/datacosmos_response.py +0 -0
  53. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/utils/missions.py +0 -0
  54. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos/utils/url.py +0 -0
  55. {datacosmos-0.0.5 → datacosmos-0.0.7}/datacosmos.egg-info/dependency_links.txt +0 -0
  56. {datacosmos-0.0.5 → datacosmos-0.0.7}/setup.cfg +0 -0
  57. {datacosmos-0.0.5 → datacosmos-0.0.7}/tests/test_pass.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datacosmos
3
- Version: 0.0.5
3
+ Version: 0.0.7
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
@@ -10,11 +10,11 @@ License-File: LICENSE.md
10
10
  Requires-Dist: pydantic_settings>=2.7.0
11
11
  Requires-Dist: requests==2.31.0
12
12
  Requires-Dist: oauthlib==3.2.0
13
- Requires-Dist: requests-oauthlib==1.3.1
14
- Requires-Dist: pydantic==2.10.6
13
+ Requires-Dist: requests-oauthlib==2
14
+ Requires-Dist: pydantic>=2
15
15
  Requires-Dist: pystac==1.12.1
16
16
  Requires-Dist: pyyaml==6.0.2
17
- Requires-Dist: structlog==25.3.0
17
+ Requires-Dist: structlog==24.4.0
18
18
  Provides-Extra: dev
19
19
  Requires-Dist: black==22.3.0; extra == "dev"
20
20
  Requires-Dist: ruff==0.9.5; extra == "dev"
@@ -55,9 +55,8 @@ If manually instantiating `Config`, default values are now applied where possibl
55
55
 
56
56
  ```python
57
57
  from datacosmos.datacosmos_client import DatacosmosClient
58
- from config.config import Config
59
- from config.models.m2m_authentication_config import M2MAuthenticationConfig
60
- from config.models.url import URL
58
+ from datacosmos.config.config import Config
59
+ from datacosmos.config.models.m2m_authentication_config import M2MAuthenticationConfig
61
60
 
62
61
  config = Config(
63
62
  authentication=M2MAuthenticationConfig(
@@ -12,8 +12,9 @@ import yaml
12
12
  from pydantic import field_validator
13
13
  from pydantic_settings import BaseSettings, SettingsConfigDict
14
14
 
15
- from config.models.m2m_authentication_config import M2MAuthenticationConfig
16
- from config.models.url import URL
15
+ from datacosmos.config.models.authentication_config import AuthenticationConfig
16
+ from datacosmos.config.models.m2m_authentication_config import M2MAuthenticationConfig
17
+ from datacosmos.config.models.url import URL
17
18
 
18
19
 
19
20
  class Config(BaseSettings):
@@ -25,7 +26,7 @@ class Config(BaseSettings):
25
26
  extra="allow",
26
27
  )
27
28
 
28
- authentication: Optional[M2MAuthenticationConfig] = None
29
+ authentication: Optional[AuthenticationConfig] = None
29
30
  stac: Optional[URL] = None
30
31
  datacosmos_cloud_storage: Optional[URL] = None
31
32
  mission_id: int = 0
@@ -94,15 +95,15 @@ class Config(BaseSettings):
94
95
  environment=os.getenv("ENVIRONMENT", "test"),
95
96
  )
96
97
 
97
- @field_validator("authentication", mode="before")
98
+ @field_validator("authentication", mode="after")
98
99
  @classmethod
99
100
  def validate_authentication(
100
- cls, auth_data: Optional[dict]
101
+ cls, auth: Optional[M2MAuthenticationConfig]
101
102
  ) -> M2MAuthenticationConfig:
102
103
  """Ensure authentication is provided and apply defaults.
103
104
 
104
105
  Args:
105
- auth_data (Optional[dict]): The authentication config as a dictionary.
106
+ auth (Optional[M2MAuthenticationConfig]): The authentication config.
106
107
 
107
108
  Returns:
108
109
  M2MAuthenticationConfig: The validated authentication configuration.
@@ -110,11 +111,10 @@ class Config(BaseSettings):
110
111
  Raises:
111
112
  ValueError: If authentication is missing or required fields are not set.
112
113
  """
113
- if not auth_data:
114
- return cls.apply_auth_defaults(M2MAuthenticationConfig())
115
-
116
- auth = cls.parse_auth_config(auth_data)
117
- auth = cls.apply_auth_defaults(auth)
114
+ if auth is None:
115
+ auth = cls.apply_auth_defaults(M2MAuthenticationConfig())
116
+ else:
117
+ auth = cls.apply_auth_defaults(auth)
118
118
 
119
119
  cls.check_required_auth_fields(auth)
120
120
  return auth
@@ -0,0 +1,15 @@
1
+ """Authentication configuration options."""
2
+
3
+ from typing import Union
4
+
5
+ from datacosmos.config.models.local_user_account_authentication_config import (
6
+ LocalUserAccountAuthenticationConfig,
7
+ )
8
+ from datacosmos.config.models.m2m_authentication_config import M2MAuthenticationConfig
9
+ from datacosmos.config.models.no_authentication_config import NoAuthenticationConfig
10
+
11
+ AuthenticationConfig = Union[
12
+ NoAuthenticationConfig,
13
+ LocalUserAccountAuthenticationConfig,
14
+ M2MAuthenticationConfig,
15
+ ]
@@ -0,0 +1,26 @@
1
+ """Configuration for local user account authentication.
2
+
3
+ When this is chosen, the user will be prompted to log in using their OPS credentials.
4
+ This will be used for running scripts locally.
5
+ """
6
+
7
+ from typing import Literal
8
+
9
+ from pydantic import BaseModel
10
+
11
+
12
+ class LocalUserAccountAuthenticationConfig(BaseModel):
13
+ """Configuration for local user account authentication.
14
+
15
+ When this is chosen, the user will be prompted to log in using their OPS credentials.
16
+ This will be used for running scripts locally.
17
+ """
18
+
19
+ type: Literal["local"]
20
+ client_id: str
21
+ authorization_endpoint: str
22
+ token_endpoint: str
23
+ redirect_port: int
24
+ scopes: str
25
+ audience: str
26
+ cache_file: str
@@ -0,0 +1,17 @@
1
+ """No authentication configuration.
2
+
3
+ This is used when running scripts in tests.
4
+ """
5
+
6
+ from typing import Literal
7
+
8
+ from pydantic import BaseModel
9
+
10
+
11
+ class NoAuthenticationConfig(BaseModel):
12
+ """No authentication configuration.
13
+
14
+ This is used when running scripts in tests.
15
+ """
16
+
17
+ type: Literal["none"]
@@ -12,7 +12,7 @@ from oauthlib.oauth2 import BackendApplicationClient
12
12
  from requests.exceptions import ConnectionError, HTTPError, RequestException, Timeout
13
13
  from requests_oauthlib import OAuth2Session
14
14
 
15
- from config.config import Config
15
+ from datacosmos.config.config import Config
16
16
  from datacosmos.exceptions.datacosmos_exception import DatacosmosException
17
17
 
18
18
 
@@ -47,7 +47,7 @@ class DatacosmosUploader:
47
47
 
48
48
  def upload_file(self, src: str, dst: str) -> None:
49
49
  """Uploads a single file to the specified destination path."""
50
- url = self.base_url.with_suffix(str(dst))
50
+ url = self.base_url.with_suffix(dst)
51
51
 
52
52
  with open(src, "rb") as f:
53
53
  response = self.datacosmos_client.put(url, data=f)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: datacosmos
3
- Version: 0.0.5
3
+ Version: 0.0.7
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
@@ -10,11 +10,11 @@ License-File: LICENSE.md
10
10
  Requires-Dist: pydantic_settings>=2.7.0
11
11
  Requires-Dist: requests==2.31.0
12
12
  Requires-Dist: oauthlib==3.2.0
13
- Requires-Dist: requests-oauthlib==1.3.1
14
- Requires-Dist: pydantic==2.10.6
13
+ Requires-Dist: requests-oauthlib==2
14
+ Requires-Dist: pydantic>=2
15
15
  Requires-Dist: pystac==1.12.1
16
16
  Requires-Dist: pyyaml==6.0.2
17
- Requires-Dist: structlog==25.3.0
17
+ Requires-Dist: structlog==24.4.0
18
18
  Provides-Extra: dev
19
19
  Requires-Dist: black==22.3.0; extra == "dev"
20
20
  Requires-Dist: ruff==0.9.5; extra == "dev"
@@ -1,11 +1,6 @@
1
1
  LICENSE.md
2
2
  README.md
3
3
  pyproject.toml
4
- config/__init__.py
5
- config/config.py
6
- config/models/__init__.py
7
- config/models/m2m_authentication_config.py
8
- config/models/url.py
9
4
  datacosmos/__init__.py
10
5
  datacosmos/datacosmos_client.py
11
6
  datacosmos.egg-info/PKG-INFO
@@ -13,6 +8,14 @@ datacosmos.egg-info/SOURCES.txt
13
8
  datacosmos.egg-info/dependency_links.txt
14
9
  datacosmos.egg-info/requires.txt
15
10
  datacosmos.egg-info/top_level.txt
11
+ datacosmos/config/__init__.py
12
+ datacosmos/config/config.py
13
+ datacosmos/config/models/__init__.py
14
+ datacosmos/config/models/authentication_config.py
15
+ datacosmos/config/models/local_user_account_authentication_config.py
16
+ datacosmos/config/models/m2m_authentication_config.py
17
+ datacosmos/config/models/no_authentication_config.py
18
+ datacosmos/config/models/url.py
16
19
  datacosmos/exceptions/__init__.py
17
20
  datacosmos/exceptions/datacosmos_exception.py
18
21
  datacosmos/stac/__init__.py
@@ -1,11 +1,11 @@
1
1
  pydantic_settings>=2.7.0
2
2
  requests==2.31.0
3
3
  oauthlib==3.2.0
4
- requests-oauthlib==1.3.1
5
- pydantic==2.10.6
4
+ requests-oauthlib==2
5
+ pydantic>=2
6
6
  pystac==1.12.1
7
7
  pyyaml==6.0.2
8
- structlog==25.3.0
8
+ structlog==24.4.0
9
9
 
10
10
  [dev]
11
11
  black==22.3.0
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "datacosmos"
7
- version = "0.0.5"
7
+ version = "0.0.7"
8
8
  authors = [
9
9
  { name="Open Cosmos", email="support@open-cosmos.com" },
10
10
  ]
@@ -18,11 +18,11 @@ dependencies = [
18
18
  "pydantic_settings>=2.7.0",
19
19
  "requests==2.31.0",
20
20
  "oauthlib==3.2.0",
21
- "requests-oauthlib==1.3.1",
22
- "pydantic==2.10.6",
21
+ "requests-oauthlib==2",
22
+ "pydantic>=2",
23
23
  "pystac==1.12.1",
24
24
  "pyyaml==6.0.2",
25
- "structlog==25.3.0"
25
+ "structlog==24.4.0"
26
26
  ]
27
27
 
28
28
  [project.optional-dependencies]
@@ -36,7 +36,7 @@ dev = [
36
36
  ]
37
37
 
38
38
  [tool.setuptools.packages.find]
39
- include = ["datacosmos*", "config*"]
39
+ include = ["datacosmos*"]
40
40
 
41
41
  [tool.bandit]
42
42
  exclude_dirs = [".venv"]
File without changes
File without changes