DownloadManager#

class ansys.tools.common.example_download.DownloadManager#

Manages downloads of example files.

Manages the download of example from the example-data repository, which is at ansys/example-data.

Overview#

clear_download_cache

Remove downloaded example files from the local path.

download_file

Download an example file from the example-data repository.

Import detail#

from ansys.tools.common.example_download import DownloadManager

Method detail#

DownloadManager.clear_download_cache()#

Remove downloaded example files from the local path.

DownloadManager.download_file(filename: str, directory: str, destination: str | None = None, force: bool = False) str#

Download an example file from the example-data repository.

Parameters#

filenamestr

Name of the example file to download.

directorystr

Path under the example-data repository.

destinationstr, default: None

Path to download the example file to. The default is None, in which case the default path for app data is used.

forcebool, default: False

Whether to always download the example file. The default is False, in which case if the example file is cached, it is reused.

Returns#

tuple[str, str]

Tuple containing the filepath to use and the local filepath of the downloaded directory. The two are different in case of containers.