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)[source]

Download a request with nice progress bars.

Parameters:
  • request (Response) – The URL download request.

  • destination (str) – The destination file name.

  • message (Optional[str]) – The message shown in the progress bar.

  • total_read (int)

Return type:

None

craft_parts.utils.url_utils.get_url_scheme(url)[source]

Return the given URL’s scheme.

Parameters:

url (str)

Return type:

str

craft_parts.utils.url_utils.is_url(url)[source]

Verify whether the given string is a valid URL.

Parameters:

url (str)

Return type:

bool