From 6c5a585d2432652c8b595a68193b3451950e6d2b Mon Sep 17 00:00:00 2001 From: kpeck Date: Mon, 29 Jun 2026 20:46:20 -0700 Subject: [PATCH 1/4] Test lazy imports for catalog, compute, vector modules --- earthdaily/earthone/__init__.py | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/earthdaily/earthone/__init__.py b/earthdaily/earthone/__init__.py index b82e620..140c33e 100644 --- a/earthdaily/earthone/__init__.py +++ b/earthdaily/earthone/__init__.py @@ -45,18 +45,23 @@ except PackageNotFoundError: from earthdaily.earthone.core.client import __version__ -from earthdaily.earthone import auth -from earthdaily.earthone import config -from earthdaily.earthone import exceptions -from earthdaily.earthone import geo -from earthdaily.earthone import utils -from earthdaily.earthone import catalog -from earthdaily.earthone import compute -from earthdaily.earthone import vector +from earthdaily.earthone import auth, config, exceptions, geo, utils select_env = config.select_env get_settings = config.get_settings +_LAZY_SUBMODULES = {"catalog", "compute", "vector"} + + +def __getattr__(name: str): + if name in _LAZY_SUBMODULES: + import importlib + + module = importlib.import_module(f"earthdaily.earthone.{name}") + globals()[name] = module + return module + raise AttributeError(f"module {__name__!r} has no attribute {name!r}") + __author__ = "EarthDaily" __all__ = [ From af570e32c8473a5f1bf4584e513e86f9af1d6ada Mon Sep 17 00:00:00 2001 From: kpeck Date: Mon, 29 Jun 2026 20:48:34 -0700 Subject: [PATCH 2/4] Bump version --- earthdaily/earthone/core/client/version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/earthdaily/earthone/core/client/version.py b/earthdaily/earthone/core/client/version.py index 3139322..1564f1b 100644 --- a/earthdaily/earthone/core/client/version.py +++ b/earthdaily/earthone/core/client/version.py @@ -12,4 +12,4 @@ # See the License for the specific language governing permissions and # limitations under the License. -__version__ = "6.0.1" +__version__ = "6.0.2" From d826ced0f656a2fa6564f9f3f6dfbe254ebec309 Mon Sep 17 00:00:00 2001 From: kpeck Date: Tue, 30 Jun 2026 15:40:39 -0700 Subject: [PATCH 3/4] Add __dir__ --- earthdaily/earthone/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/earthdaily/earthone/__init__.py b/earthdaily/earthone/__init__.py index 140c33e..69e2c0b 100644 --- a/earthdaily/earthone/__init__.py +++ b/earthdaily/earthone/__init__.py @@ -62,6 +62,10 @@ def __getattr__(name: str): return module raise AttributeError(f"module {__name__!r} has no attribute {name!r}") + +def __dir__(): + return __all__ + __author__ = "EarthDaily" __all__ = [ From 78a400f314c5a6124a73db161c9228fea8becde6 Mon Sep 17 00:00:00 2001 From: kpeck Date: Tue, 30 Jun 2026 16:37:43 -0700 Subject: [PATCH 4/4] Lazy load more modules --- earthdaily/earthone/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/earthdaily/earthone/__init__.py b/earthdaily/earthone/__init__.py index 69e2c0b..24d5a58 100644 --- a/earthdaily/earthone/__init__.py +++ b/earthdaily/earthone/__init__.py @@ -45,12 +45,12 @@ except PackageNotFoundError: from earthdaily.earthone.core.client import __version__ -from earthdaily.earthone import auth, config, exceptions, geo, utils +from earthdaily.earthone import config select_env = config.select_env get_settings = config.get_settings -_LAZY_SUBMODULES = {"catalog", "compute", "vector"} +_LAZY_SUBMODULES = {"auth", "catalog", "compute", "exceptions", "geo", "utils", "vector"} def __getattr__(name: str):