get_test_data
¶
Classes:
ZenodoDataDownloader
¶
Methods:
-
download_and_extract_parallel–Parallelize multiple downloads with optional extraction per job.
-
download_file–Download a single file to the cache folder.
Source code in geokit/core/get_test_data.py
download_and_extract_parallel
¶
download_and_extract_parallel(
download_list: list[
tuple[str, str | None, str | None, dict | None]
],
max_workers: int = 4,
) -> list[Path]
Parallelize multiple downloads with optional extraction per job.
Each download_list entry: (url, filename_or_none, extract_dir_or_none, header). If extract_dir is provided, the downloaded file is extracted there (zip only).
Args: download_list: List of jobs, each defined by a tuple of (url, filename_or_none, extract_dir_or_none, header). max_workers: Maximum number of threads to use for concurrent downloads.
Returns:
-
list[pathlib.Path]: Paths to the downloaded files or extraction folders–in the same order as the input download_list.
Raises:
-
Exception: If any download or extraction job fails. The original–exception from the worker is attached as the cause of the raised Exception.
Source code in geokit/core/get_test_data.py
download_file
¶
download_file(
url: str,
filename: str | None = None,
headers: dict | None = None,
overwrite: bool = False,
max_attempts: int = 3,
backoff_seconds: float = 5.0,
) -> Path
Download a single file to the cache folder.
If filename is omitted, it is derived from the URL path. Set
overwrite to re-download an existing file.
max_attempts controls retries for transient failures.