Download Btn#

Overview#

DownloadBtn is custom widget to provide easy to use button in the pysepal framework. it inherits from the SepalWidget class. Any argument from the original Btn ipyvuetify class can be used to complement it. It is used to store download path. The default color is set to “success”. if no URL is set the button is disabled.

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

btn = sw.DownloadBtn(text = "a file")
btn
/home/docs/checkouts/pysepal/envs/latest/lib/python3.10/site-packages/google/api_core/_python_version_support.py:212: FutureWarning: You are using a non-supported Python version (3.10.20). Google will not post any further updates to google.api_core supporting this Python version. Please upgrade to the latest Python version, or at least Python 3.11, and then update google.api_core.
  warnings.warn(message, FutureWarning)

Methods#

the linked URL can be dynamically set with the set_url method.

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

btn = sw.DownloadBtn(text = "Pokepedia")
btn.set_url('https://www.pokepedia.fr/images/7/76/Pikachu-DEPS.png')
btn

Note

More information can be found here.