llama.com.dl package

Module for downloading publicly-accessible files.

llama.com.dl.download(url: str, filename: str, sha256sum: str = None, mkdirs: bool = False)

Download the file located at url and save it to path filename. If sha256sum is specified, check the downloaded file’s sha256 hex digest against that value and raise an IOError if they do not match. If mkdirs is True, make any intermediate directories as required.

llama.com.dl.sizeof_fmt(num, suffix='B')

Format the size of a file in a human-readable way. num is the file size, presumed to be in bytes. Specify suffix='b' to indicate that the unit of num is bits.