OCDocker.Toolbox.Downloading module

Download helpers with progress-bar support for files and datasets.

Usage:

import OCDocker.Toolbox.Downloading as ocdown

class OCDocker.Toolbox.Downloading.DownloadProgressBar(*_, **__)[source]

Bases: tqdm

Deal with the progress bar to track download. Extends the tqdm class.

update_to(b=1, bsize=1, tsize=0)[source]

Update the progress bar.

Parameters:
  • b (int, optional) – Number of blocks transferred so far [1]

  • bsize (int, optional) – Size of each block (in tqdm units) [1]

  • tsize (int, optional) – Total size (in tqdm units). If [None] remains unchanged.

Return type:

None

OCDocker.Toolbox.Downloading.download_url(url, out_path)[source]

Download a file from given url.

Parameters:
  • url (str) – The url to download the file from.

  • out_path (str) – The path where the file will be downloaded.

Return type:

None