fetch_demo
Note
This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the Habitat Guide and Python API guide (v2.0) for usage.
- fetch_demo(*, data_home: str | Path | None = None, force: bool = False, verbose: bool = True, url: str | None = None, sha256: str | None = None) Path[source]
Download the official preprocessed demo pack once and return its root.
Later calls reuse the cache (or a local
demo_data/preprocessedtree in the current working directory) and do not hit the network. Whenverboseis true the function prints the absolute path and a layout report so users can see where the files landed and how to arrange their own data.- Parameters:
data_home – Cache root override (default:
HABIT_DATAor~/.habit_data).force – If true, download again even when a valid cache exists.
verbose – If true, print the path and the layout report to stdout.
url – Optional download URL (tests / mirrors). Default is the official GitHub Release asset.
sha256 – Optional lowercase hex digest of the zip. Default is the official pack checksum.
- Returns:
Absolute path of the preprocessed root (contains
images/andmasks/). Pass this tocohort_from_directory().- Raises:
HabitError – Network or extract failure.
DataFormatError – Checksum mismatch or extracted tree is invalid.