REGISTER NOW: DdS Autumn School! 🇨🇭 Grosshöchstetten (Switzerland) 🗓️ 6.-11. October 2024

bw2io.download_utils#

Module Contents#

Functions#

download_with_progressbar(url[, filename, dirpath, ...])

Download file from URL and show progress bar.

get_filename(response)

Get filename from response headers or URL.

bw2io.download_utils.download_with_progressbar(url, filename=None, dirpath=None, chunk_size=4096 * 8)[source]#

Download file from URL and show progress bar.

Parameters#

urlstr

URL to download from.

filenamestr, optional

Filename to save to. If not given, will be determined from URL.

dirpathstr, optional

Directory to save to. If not given, will be current working directory.

chunk_sizeint, optional

Chunk size to use when downloading.

Returns#

pathlib.Path

Path to downloaded file.

bw2io.download_utils.get_filename(response)[source]#

Get filename from response headers or URL.

Parameters#

response : requests.Response

Returns#

str

Filename