frame_cli.downloaders.hydroshare module¶
Module containing the HydroshareDownloader class.
- class frame_cli.downloaders.hydroshare.HydroshareDownloader[source]¶
Bases:
Downloader
Downloader for Hydroshare datasets.
- _abc_impl = <_abc._abc_data object>¶
- download(url: str, *args, destination: str | None = None, **kwargs) → str[source]¶
Download the content at the given URL.
- Returns:
The destination directory.
- Return type:
str
- Parameters:
url (str) – URL of the content to download.
destination (str) – Destination directory to save the content to. Defaults to None, which saves to the current working directory.
Raises:
- frame_cli.downloaders.hydroshare._check_url(url: str) → None[source]¶
Check that the url has the format “http://www.hydroshare.org/resource/XXXX”.
- Parameters:
url (str) – URL to check.
- Raises:
ValueError – The URL does not have the correct format.
- frame_cli.downloaders.hydroshare._download_archive(url: str, dir_path: str) → str[source]¶
Download the archive from the given URL to the given directory.
- Parameters:
url (str) – URL of the archive to download.
dir_path (str) – Directory to save the archive to.
- Returns:
Path to the downloaded archive.
- Return type:
archive_path (str)