afnio.utils.datasets.utils#

Functions

calculate_md5(fpath[, chunk_size])

check_integrity(fpath[, md5])

check_md5(fpath, md5, **kwargs)

download(url, download_root[, extract_root, ...])

download_url(url, root[, filename, md5, ...])

Download a file from a url and place it in root.

afnio.utils.datasets.utils.calculate_md5(fpath, chunk_size=1048576)[source]#
afnio.utils.datasets.utils.check_integrity(fpath, md5=None)[source]#
afnio.utils.datasets.utils.check_md5(fpath, md5, **kwargs)[source]#
afnio.utils.datasets.utils.download(url, download_root, extract_root=None, filename=None, md5=None, remove_finished=False)[source]#
afnio.utils.datasets.utils.download_url(url, root, filename=None, md5=None, max_redirect_hops=3)[source]#

Download a file from a url and place it in root.

Parameters:
  • url (str) – URL to download file from

  • root (str) – Directory to place downloaded file in

  • filename (str, optional) – Name to save the file under. If None, use the basename of the URL

  • md5 (str, optional) – MD5 checksum of the download. If None, do not check

  • max_redirect_hops (int, optional) – Maximum number of redirect hops allowed