wolfhece.pydownloader
Author: HECE - University of Liege, Pierre Archambeau Date: 2025
Copyright (c) 2025 University of Liege. All rights reserved.
This script and its content are protected by copyright law. Unauthorized copying or distribution of this file, via any medium, is strictly prohibited.
Module Contents
- class wolfhece.pydownloader.DownloadType(*args, **kwds)[source]
Bases:
enum.Enum
Enum to define the type of download.
- class wolfhece.pydownloader.DownloadFiles(*args, **kwds)[source]
Bases:
enum.Enum
Enum to define the files to download.
- class wolfhece.pydownloader.DonwloadDirectories(*args, **kwds)[source]
Bases:
enum.Enum
Enum to define the directories for downloads.
- wolfhece.pydownloader.GITLAB_EXAMPLE = 'https://gitlab.uliege.be/HECE/wolf_examples/-/raw/main'[source]
- wolfhece.pydownloader.clean_url(url: str) str [source]
Clean the URL by removing any query parameters or fragments.
- Parameters:
url (str) – The URL to clean.
- Returns:
The cleaned URL.
- Return type:
str
- wolfhece.pydownloader.download_file(url: str, destination: str | pathlib.Path = None, download_type: DownloadType = DownloadType.HTTP, load_from_cache: bool = True) None [source]
Download a file from the specified URL to the destination path.
- Parameters:
url (str) – The URL of the file to download.
destination (Union[str, Path]) – The path where the file will be saved.
download_type (DownloadType) – The type of download (HTTP, HTTPS, FTP).
- Returns:
None
- Raises:
requests.HTTPError – If the HTTP request fails.