BaseReader

BaseReader#

class BaseReader(*args, **kwargs)[source]#

The Base Reader class.

The base functionality includes reading data from a file, and allowing access to the underlying vtk reader. See pyvista.get_reader() for an example using a built-in subclass.

Subclasses parameterize BaseReader with the concrete DataObject subclass they produce, e.g. XMLPolyDataReader is declared as class XMLPolyDataReader(BaseReader[PolyData], ...) so read() returns PolyData under static analysis without each subclass needing its own read override.

Parameters:
pathstr, Path

Path of the file to read.

Methods#

BaseReader.hide_progress()

Hide the progress bar when loading the file.

BaseReader.read(*[, validate])

Read data in file.

BaseReader.show_progress([msg])

Show a progress bar when loading the file.

Attributes#

BaseReader.path

Return or set the filename or directory of the reader.

BaseReader.reader

Return the vtk Reader object.