ee-client 2.5.0__tar.gz → 2.5.2__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.
Files changed (33) hide show
  1. {ee_client-2.5.0 → ee_client-2.5.2}/PKG-INFO +2 -2
  2. {ee_client-2.5.0 → ee_client-2.5.2}/ee_client.egg-info/PKG-INFO +2 -2
  3. {ee_client-2.5.0 → ee_client-2.5.2}/ee_client.egg-info/SOURCES.txt +1 -0
  4. {ee_client-2.5.0 → ee_client-2.5.2}/ee_client.egg-info/requires.txt +1 -1
  5. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/__init__.py +1 -1
  6. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/client.py +2 -0
  7. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/exceptions.py +2 -0
  8. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/export/table.py +2 -2
  9. {ee_client-2.5.0 → ee_client-2.5.2}/pyproject.toml +3 -3
  10. {ee_client-2.5.0 → ee_client-2.5.2}/tests/test_data.py +0 -20
  11. ee_client-2.5.2/tests/test_export_table.py +79 -0
  12. {ee_client-2.5.0 → ee_client-2.5.2}/LICENSE +0 -0
  13. {ee_client-2.5.0 → ee_client-2.5.2}/README.rst +0 -0
  14. {ee_client-2.5.0 → ee_client-2.5.2}/ee_client.egg-info/dependency_links.txt +0 -0
  15. {ee_client-2.5.0 → ee_client-2.5.2}/ee_client.egg-info/top_level.txt +0 -0
  16. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/cache.py +0 -0
  17. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/data.py +0 -0
  18. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/export/__init__.py +0 -0
  19. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/export/image.py +0 -0
  20. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/helpers.py +0 -0
  21. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/interfaces/__init__.py +0 -0
  22. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/interfaces/export.py +0 -0
  23. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/interfaces/operations.py +0 -0
  24. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/interfaces/tasks.py +0 -0
  25. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/models.py +0 -0
  26. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/oauth_app.py +0 -0
  27. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/sepal_credential_mixin.py +0 -0
  28. {ee_client-2.5.0 → ee_client-2.5.2}/eeclient/tasks.py +0 -0
  29. {ee_client-2.5.0 → ee_client-2.5.2}/setup.cfg +0 -0
  30. {ee_client-2.5.0 → ee_client-2.5.2}/tests/test_cache.py +0 -0
  31. {ee_client-2.5.0 → ee_client-2.5.2}/tests/test_client.py +0 -0
  32. {ee_client-2.5.0 → ee_client-2.5.2}/tests/test_integration_get_assets.py +0 -0
  33. {ee_client-2.5.0 → ee_client-2.5.2}/tests/test_models.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ee-client
3
- Version: 2.5.0
3
+ Version: 2.5.2
4
4
  Summary: extends the capabilities of the earthengine-api by providing custom session management and client interactions
5
5
  Author-email: Daniel Guerrero <dfgm2006@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/dfguerrerom/ee-client
@@ -16,7 +16,6 @@ Description-Content-Type: text/x-rst
16
16
  License-File: LICENSE
17
17
  Requires-Dist: earthengine-api
18
18
  Requires-Dist: httpx[http2]
19
- Requires-Dist: aiogoogle
20
19
  Requires-Dist: tenacity
21
20
  Requires-Dist: pydantic
22
21
  Provides-Extra: dev
@@ -26,6 +25,7 @@ Requires-Dist: nox; extra == "dev"
26
25
  Requires-Dist: tomli; extra == "dev"
27
26
  Requires-Dist: mypy; extra == "dev"
28
27
  Requires-Dist: pytest; extra == "dev"
28
+ Requires-Dist: pytest-asyncio; extra == "dev"
29
29
  Requires-Dist: flask; extra == "dev"
30
30
  Dynamic: license-file
31
31
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ee-client
3
- Version: 2.5.0
3
+ Version: 2.5.2
4
4
  Summary: extends the capabilities of the earthengine-api by providing custom session management and client interactions
5
5
  Author-email: Daniel Guerrero <dfgm2006@gmail.com>
6
6
  Project-URL: Homepage, https://github.com/dfguerrerom/ee-client
@@ -16,7 +16,6 @@ Description-Content-Type: text/x-rst
16
16
  License-File: LICENSE
17
17
  Requires-Dist: earthengine-api
18
18
  Requires-Dist: httpx[http2]
19
- Requires-Dist: aiogoogle
20
19
  Requires-Dist: tenacity
21
20
  Requires-Dist: pydantic
22
21
  Provides-Extra: dev
@@ -26,6 +25,7 @@ Requires-Dist: nox; extra == "dev"
26
25
  Requires-Dist: tomli; extra == "dev"
27
26
  Requires-Dist: mypy; extra == "dev"
28
27
  Requires-Dist: pytest; extra == "dev"
28
+ Requires-Dist: pytest-asyncio; extra == "dev"
29
29
  Requires-Dist: flask; extra == "dev"
30
30
  Dynamic: license-file
31
31
 
@@ -26,5 +26,6 @@ eeclient/interfaces/tasks.py
26
26
  tests/test_cache.py
27
27
  tests/test_client.py
28
28
  tests/test_data.py
29
+ tests/test_export_table.py
29
30
  tests/test_integration_get_assets.py
30
31
  tests/test_models.py
@@ -1,6 +1,5 @@
1
1
  earthengine-api
2
2
  httpx[http2]
3
- aiogoogle
4
3
  tenacity
5
4
  pydantic
6
5
 
@@ -11,4 +10,5 @@ nox
11
10
  tomli
12
11
  mypy
13
12
  pytest
13
+ pytest-asyncio
14
14
  flask
@@ -1,6 +1,6 @@
1
1
  __title__ = "eeclient"
2
2
  __summary__ = "A client for Google Earth Engine"
3
- __version__ = "2.5.0"
3
+ __version__ = "2.5.2"
4
4
 
5
5
  __author__ = "Daniel Guerrero"
6
6
  __email__ = "dfgm2006@gmail.com"
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from typing import Any, Dict, Literal, Optional
2
4
 
3
5
  import os
@@ -1,3 +1,5 @@
1
+ from __future__ import annotations
2
+
1
3
  from ee.ee_exception import EEException
2
4
 
3
5
 
@@ -58,7 +58,7 @@ class ExportOptions(BaseExportModel):
58
58
  workload_tag: Optional[str] = None
59
59
  priority: Optional[int] = None
60
60
  file_export_options: Optional[DriveOptions] = None
61
- drive_export_options: Optional[AssetOptions] = None
61
+ asset_export_options: Optional[AssetOptions] = None
62
62
  # TODO: Add support for other export options.
63
63
  # See the api: https://developers.google.com/earth-engine/reference/rest/v1alpha/projects.table/export#TableFileExportOptions
64
64
 
@@ -105,7 +105,7 @@ async def _export_table(
105
105
  workload_tag=workload_tag,
106
106
  priority=priority,
107
107
  file_export_options=drive_options,
108
- drive_export_options=asset_options,
108
+ asset_export_options=asset_options,
109
109
  )
110
110
 
111
111
  params = export_options.model_dump(by_alias=True, exclude_none=True)
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "ee-client"
7
- version = "2.5.0"
7
+ version = "2.5.2"
8
8
  description = "extends the capabilities of the earthengine-api by providing custom session management and client interactions"
9
9
  readme = { file = "README.rst", content-type = "text/x-rst" }
10
10
  authors = [
@@ -13,7 +13,6 @@ authors = [
13
13
  dependencies = [
14
14
  "earthengine-api",
15
15
  "httpx[http2]",
16
- "aiogoogle",
17
16
  "tenacity",
18
17
  "pydantic",
19
18
  ]
@@ -40,6 +39,7 @@ dev = [
40
39
  "tomli",
41
40
  "mypy",
42
41
  "pytest",
42
+ "pytest-asyncio",
43
43
  "flask",
44
44
  ]
45
45
 
@@ -66,7 +66,7 @@ branch = true
66
66
  [tool.commitizen]
67
67
  tag_format = "v$major.$minor.$patch$prerelease"
68
68
  update_changelog_on_bump = false
69
- version = "2.5.0"
69
+ version = "2.5.2"
70
70
  version_files = [
71
71
  "pyproject.toml:version",
72
72
  "eeclient/__init__.py:__version__",
@@ -123,26 +123,6 @@ async def test_get_info(sepal_headers):
123
123
  assert result is not None
124
124
 
125
125
 
126
- @pytest.mark.asyncio
127
- async def test_create_and_get_asset(sepal_headers):
128
- """
129
- Create a folder asset and then retrieve it via get_asset.
130
- """
131
- session = EESession(sepal_headers=sepal_headers)
132
- folder_name = f"test_folder_{random_hash()}/subfolder"
133
- folder_id = await create_folder(session, folder=folder_name)
134
-
135
- # Allow some time for the asset to be fully registered
136
- await asyncio.sleep(2)
137
- asset = await get_asset(session, asset_id=folder_id)
138
- assert asset is not None, f"Asset not found: {folder_id}"
139
- assert asset["id"] == folder_id
140
- assert asset["type"] == "FOLDER"
141
-
142
- # Clean up
143
- await delete_folder(session, folder_id=folder_id, recursive=True)
144
-
145
-
146
126
  @pytest.mark.asyncio
147
127
  async def test_list_assets_concurrently(sepal_headers):
148
128
  """
@@ -0,0 +1,79 @@
1
+ from unittest.mock import AsyncMock, patch
2
+
3
+ import pytest
4
+
5
+ from eeclient.export.table import (
6
+ AssetOptions,
7
+ DriveDestination,
8
+ DriveOptions,
9
+ EarthEngineDestination,
10
+ ExportOptions,
11
+ TableFileFormat,
12
+ table_to_asset_async,
13
+ )
14
+
15
+
16
+ def test_asset_export_options_serialize_with_correct_key():
17
+ opts = ExportOptions(
18
+ expression={"x": 1},
19
+ asset_export_options=AssetOptions(
20
+ earth_engine_destination=EarthEngineDestination(name="projects/p/assets/t")
21
+ ),
22
+ )
23
+ payload = opts.model_dump(by_alias=True, exclude_none=True)
24
+ assert "assetExportOptions" in payload
25
+ assert "driveExportOptions" not in payload
26
+ assert payload["assetExportOptions"]["earthEngineDestination"]["name"] == (
27
+ "projects/p/assets/t"
28
+ )
29
+
30
+
31
+ def test_drive_export_options_serialize_as_file_export_options():
32
+ opts = ExportOptions(
33
+ expression={"x": 1},
34
+ file_export_options=DriveOptions(
35
+ file_format=TableFileFormat.CSV,
36
+ drive_destination=DriveDestination(filename_prefix="out"),
37
+ ),
38
+ )
39
+ payload = opts.model_dump(by_alias=True, exclude_none=True)
40
+ assert "fileExportOptions" in payload
41
+ assert "driveExportOptions" not in payload
42
+ assert "assetExportOptions" not in payload
43
+
44
+
45
+ @pytest.mark.asyncio
46
+ async def test_table_to_asset_async_sends_asset_export_options():
47
+ client = AsyncMock()
48
+ client.rest_call = AsyncMock(
49
+ return_value={
50
+ "name": "projects/p/operations/X",
51
+ "metadata": {
52
+ "@type": "type.googleapis.com/google.earthengine.v1.OperationMetadata",
53
+ "description": "myExportTableTask",
54
+ "priority": 100,
55
+ "createTime": "2026-04-20T00:00:00Z",
56
+ "type": "EXPORT_FEATURES",
57
+ },
58
+ "done": False,
59
+ }
60
+ )
61
+
62
+ fake_expression = {"values": {}, "result": "0"}
63
+ with patch(
64
+ "eeclient.export.table.serializer.encode", return_value=fake_expression
65
+ ), patch("eeclient.export.table.encodable.Encodable", object):
66
+ await table_to_asset_async(
67
+ client=client,
68
+ collection=object(),
69
+ asset_id="projects/p/assets/t",
70
+ )
71
+
72
+ assert client.rest_call.await_count == 1
73
+ _, kwargs = client.rest_call.call_args
74
+ payload = kwargs["data"]
75
+ assert "assetExportOptions" in payload
76
+ assert "driveExportOptions" not in payload
77
+ assert payload["assetExportOptions"]["earthEngineDestination"]["name"] == (
78
+ "projects/p/assets/t"
79
+ )
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