download#

MapdlGrpc.download(files, target_dir=None, extension=None, chunk_size=None, progress_bar=None, recursive=False)#

Download files from the gRPC instance working directory :rtype: List[str]

Warning

This feature is only available for MAPDL 2021R1 or newer.

Parameters:
filesstr or List[str] or tuple(str)

Name of the file on the server. File must be in the same directory as the mapdl instance. A list of string names or tuples of string names can also be used. List current files with Mapdl.list_files.

Alternatively, you can also specify glob expressions to match file names. For example: ‘file*’ to match every file whose name starts with ‘file’.

target_dirstr, optional

Path where the downloaded files will be located. The default is the current working directory.

extensionstr, optional

Filename with this extension will be considered. The default is None.

chunk_sizeint, optional

Chunk size in bytes. Must be less than 4MB. The default is 256 kB.

progress_barbool, optional

Display a progress bar using tqdm when True. Helpful for showing download progress.

recursivebool, optional

Whether to use recursion when using glob pattern. The default is False.

Notes

There are some considerations to keep in mind when using this command:

  • The glob pattern search does not search recursively in remote instances.

  • In a remote instance, it is not possible to list or download files in different locations than the MAPDL working directory.

  • If you are in local and provide a file path, downloading files from a different folder is allowed. However it is not a recommended approach.

Examples

Download a single file:

>>> mapdl.download('file.out')

Download all the files starting with ‘file’:

>>> mapdl.download('file*')

Download every single file in the MAPDL working directory:

>>> mapdl.download('*.*')

Alternatively, you can download all the files using Mapdl.download_project (recommended):

>>> mapdl.download_project()