AssetSelect#
Overview#
AssetSelect is a field widget to search for asset in the user GEE root folder. it inherits from the SepalWidget class.
Any argument from the original Combobox ipyvuetify class can be used to complement it.
from pysepal import sepalwidgets as sw
# correct colors for the documentation
# set to dark in SEPAL by default
import ipyvuetify as v
v.theme.dark = False
# to allow the build of the doc in a distanct server
FOLDER = "projects/earthengine-legacy/assets/users/bornToBeAlive/sepal_ui_test"
asset_select = sw.AssetSelect(folder=FOLDER)
asset_select
/home/docs/checkouts/readthedocs.org/user_builds/pysepal/envs/latest/lib/python3.10/site-packages/google/api_core/_python_version_support.py:273: FutureWarning: You are using a Python version (3.10.19) which Google will stop supporting in new releases of google.api_core once it reaches its end of life (2026-10-04). Please upgrade to the latest Python version, or at least Python 3.11, to continue receiving updates for google.api_core past that date. warnings.warn(message, FutureWarning)
---------------------------------------------------------------------------
FileNotFoundError Traceback (most recent call last)
File ~/checkouts/readthedocs.org/user_builds/pysepal/checkouts/latest/pysepal/scripts/gee.py:50, in need_ee.<locals>.wrapper_ee(*args, **kwargs)
49 try:
---> 50 init_ee()
51 except Exception:
File ~/checkouts/readthedocs.org/user_builds/pysepal/checkouts/latest/pysepal/scripts/gee.py:381, in init_ee()
380 # Extract the project name from credentials
--> 381 _credentials = json.loads(credential_file_path.read_text())
382 project_id = _credentials.get("project_id", _credentials.get("project", None))
File ~/.asdf/installs/python/3.10.19/lib/python3.10/pathlib.py:1134, in Path.read_text(self, encoding, errors)
1133 encoding = io.text_encoding(encoding)
-> 1134 with self.open(mode='r', encoding=encoding, errors=errors) as f:
1135 return f.read()
File ~/.asdf/installs/python/3.10.19/lib/python3.10/pathlib.py:1119, in Path.open(self, mode, buffering, encoding, errors, newline)
1118 encoding = io.text_encoding(encoding)
-> 1119 return self._accessor.open(self, mode, buffering, encoding, errors,
1120 newline)
FileNotFoundError: [Errno 2] No such file or directory: '/home/docs/.config/earthengine/credentials'
During handling of the above exception, another exception occurred:
Exception Traceback (most recent call last)
Cell In[1], line 11
8 # to allow the build of the doc in a distanct server
9 FOLDER = "projects/earthengine-legacy/assets/users/bornToBeAlive/sepal_ui_test"
---> 11 asset_select = sw.AssetSelect(folder=FOLDER)
12 asset_select
File ~/checkouts/readthedocs.org/user_builds/pysepal/checkouts/latest/pysepal/scripts/gee.py:52, in need_ee.<locals>.wrapper_ee(*args, **kwargs)
50 init_ee()
51 except Exception:
---> 52 raise Exception("This function needs an Earth Engine authentication")
54 return func(*args, **kwargs)
Exception: This function needs an Earth Engine authentication
the value can be retrieve from the v_model trait.
Note
More information can be found here.