colour.utilities.download_url#

colour.utilities.download_url(url: str, filename: str | None = None, sha256: str | None = None, retries: int = 6) str[source]#

Download a file from url and cache it locally.

Parameters:
  • url (str) – URL to download.

  • filename (str | None) – Explicit file path to save to. If provided, the URL-derived cache path is ignored.

  • sha256 (str | None) – Expected SHA-256 hash of the file. If provided, the downloaded file will be verified and re-downloaded on mismatch.

  • retries (int) – Number of retries in case of network errors or hash mismatches.

Returns:

Absolute path to the cached file.

Return type:

str