craft_parts.utils.url_utils module
URL parsing and downloading helpers.
-
craft_parts.utils.url_utils.download_request(request, destination, message=None, total_read=0)
Download a request with nice progress bars.
- Parameters:
request (Response) – The URL download request.
destination (Path) – The destination file name.
message (str | None) – The message shown in the progress bar.
total_read (int)
- Return type:
None
-
craft_parts.utils.url_utils.get_url_scheme(url)
Return the given URL’s scheme.
- Parameters:
url (str)
- Return type:
str
-
craft_parts.utils.url_utils.is_url(url)
Verify whether the given string is a valid URL.
- Parameters:
url (str)
- Return type:
bool