diff --git a/earthdaily/earthone/__init__.py b/earthdaily/earthone/__init__.py index b82e620..24d5a58 100644 --- a/earthdaily/earthone/__init__.py +++ b/earthdaily/earthone/__init__.py @@ -45,18 +45,27 @@ 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 select_env = config.select_env get_settings = config.get_settings +_LAZY_SUBMODULES = {"auth", "catalog", "compute", "exceptions", "geo", "utils", "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}") + + +def __dir__(): + return __all__ + __author__ = "EarthDaily" __all__ = [ 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"