Utils reference

Downloader

class nusex.utils.Downloader(of_type)

A utility class for downloading assets.

Parameters

of_type (str) – The type of asset to download (must be either “templates” or “licenses”).

of_type

The type of asset to download (must be either “templates” or “licenses”).

Type

str

extension

The file extension of the files to search for.

Type

str

url

The repo to search for files in.

Type

str

files

A series of file URLs.

Type

list[str]

completed

The number of files that have been downloaded.

Type

int

download(display_progress=False)

Download files. The files will be fetched automatically if they have not already been.

Parameters

display_progress (bool) – Whether to display the download’s progress in the terminal. Defaults to False.

Raises

DownloadError – There was a problem fetching the files.

fetch()

Fetch the files to download.

Raises

DownloadError – There was a problem fetching the files.

property progress

The download progress as a percentage.

Returns

float