download_file

download_file#

download_file(filename: str) str | list[str][source]#

Download a single file from the pyvista/data repository.

You can add an example file at pyvista/data.

Parameters:
filenamestr

Filename relative to the Data directory.

Returns:
outputstr | list

A single path if the file is not an archive. A list of paths if the file is an archive.

Examples#

Download Python source code | Download Jupyter notebook

Download the 'puppy.jpg' image.

>>> from pyvista import examples
>>> path = examples.download_file('puppy.jpg')
>>> path
'/home/user/.cache/pyvista_3/puppy.jpg'