colour_datasets.utilities.url_download

colour_datasets.utilities.url_download(url: str, filename: str, md5: Optional[str] = None, retries: int = 3)[source]

Download given url and saves its content at given file.

Parameters
  • url (str) – Url to download.

  • filename (str) – File to save the url content at.

  • md5 (Optional[str]) – Message Digest 5 (MD5) hash of the content at given url. If provided the saved content at given file will be hashed and compared to md5.

  • retries (int) – Number of retries in case where a networking error occurs or the MD5 hash is not matching.

Examples

>>> import os
>>> url_download(
...     'https://github.com/colour-science/colour-datasets', os.devnull)