pyvista.examples.downloads.download_file#

download_file(filename)[source]#

Download a single file from the PyVista vtk-data repository.

You can add an example file at pyvista/vtk_data.

Parameters:
filenamestr

Filename relative to the Data directory.

Returns:
str | list

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

Examples

Download the 'puppy.jpg' image.

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