Summary#

download_file

Download an example file from the Ansys example data repository.

Description#

Helper module to download project code examples.

Module detail#

examples.download_file(save_path: str, file_name: str, directory: str | None = None) str#

Download an example file from the Ansys example data repository.

Parameters:
save_pathstr

Path to download the file to.

file_namestr

Name of the file.

directorystr, optional

Name of the directory in the Ansys example data repository where the file is located. If a directory is not specified, this method looks for the file in the root directory of the repository.

Returns:
str

Path of the downloaded file.

Examples

>>> from ansys.rocky.core.examples import download_file
>>> file_path = download_file('', 'bracket.iges', 'geometry')
'/bracket.iges'
examples.ANSYS_EXAMPLE_DATA_REPO = 'https://github.com/ansys/example-data/raw/master'#
examples.logger#