download#
- MapdlGrpc.download(files, target_dir=None, chunk_size=None, progress_bar=None, recursive=False)#
Download files from the gRPC instance workind directory
Warning
This feature is only available for MAPDL 2021R1 or newer.
- Parameters:
- files
str
orList
[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.directory
.Alternatively, you can also specify glob expressions to match file names. For example: ‘file*’ to match every file whose name starts with ‘file’.
- chunk_size
int
,optional
Chunk size in bytes. Must be less than 4MB. Defaults to 256 kB.
- progress_barbool,
optional
Display a progress bar using
tqdm
whenTrue
. Helpful for showing download progress.- recursivebool
Use recursion when using glob pattern.
- files
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 workind directory:
>>> mapdl.download('*.*')
Alternatively, you can download all the files using
Mapdl.download_project
(recommended):>>> mapdl.download_project()