Readers & Writers#

PyVista provides class based readers to have more control over reading data files. These classes allow for more fine-grained control over reading datasets from files. See pyvista.get_reader() for a list of supported file formats. The writer classes used by pyvista.DataObject.save() are listed further down this page.

Also, see Load Data Using a Reader for a full example using reader classes.

get_reader(filename[, force_ext])

Get a reader for fine-grained control of reading data files.

Reading Functions#

These functions read a file in a single call, selecting the reader from the file extension. To write a file, see save().

get_ext(filename)

Extract the extension of the filename.

read(...)

Read any file type supported by vtk or meshio.

read_exodus(filename, *[, ...])

Read an ExodusII file ('.e' or '.exo').

read_grdecl(filename, *[, elevation, ...])

Read a GRDECL file ('.GRDECL').

read_texture(filename, *[, progress_bar])

Load a texture from an image file.

See also

Load and Plot From a File

Load and plot a mesh from a file.

Conversions

Read and write files with meshio.

Reader Classes#

AVSucdReader(*args, **kwargs)

Reader for the AVS UCD format (.inp).

BinaryMarchingCubesReader(*args, **kwargs)

Reader for the Binary Marching Cubes format (.tri).

BMPReader(*args, **kwargs)

Reader for the BMP Image format (.bmp).

BYUReader(*args, **kwargs)

Reader for the MOVIE.BYU format (.g).

CGNSReader(*args, **kwargs)

Reader for the CGNS format (.cgns).

DEMReader(*args, **kwargs)

Reader for the Digital Elevation Model format (.dem).

DICOMReader(*args, **kwargs)

Reader for the DICOM format (.dcm, .img).

EnSightReader(*args, **kwargs)

Reader for the EnSight format (.case).

ExodusIIBlockSet(*args, **kwargs)

Class for enabling and disabling blocks, sets, and block/set arrays in Exodus II files.

ExodusIIReader(*args, **kwargs)

Reader for the Exodus II format (.e, .ex2, .exii, .exo).

FacetReader(*args, **kwargs)

Reader for the Facet Polygonal Data format (.facet).

FLUENTCFFReader(*args, **kwargs)

Reader for the Fluent CFF Case format (.h5).

FluentReader(*args, **kwargs)

Reader for the Fluent Case format (.cas).

GambitReader(*args, **kwargs)

Reader for the GAMBIT Neutral format (.neu).

GaussianCubeReader(*args, **kwargs)

Reader for the Gaussian Cube format (.cube).

GESignaReader(*args, **kwargs)

Reader for the GE Signa MR format (.mr).

GIFReader(*args, **kwargs)

Reader for the GIF Image format (.gif).

GLTFReader(*args, **kwargs)

Reader for the glTF 2.0 format (.glb, .gltf).

GRDECLReader(*args, **kwargs)

Reader for the Eclipse GRDECL format (.grdecl).

HDFReader(*args, **kwargs)

Reader for the VTKHDF format (.hdf, .vtkhdf).

HDRReader(*args, **kwargs)

Reader for the Radiance HDR format (.hdr).

JPEGReader(*args, **kwargs)

Reader for the JPEG Image format (.jpeg, .jpg).

MetaImageReader(*args, **kwargs)

Reader for the MetaImage format (.mha, .mhd).

MFIXReader(*args, **kwargs)

Reader for the MFIX format (.res).

MINCImageReader(*args, **kwargs)

Reader for the MINC Image format (.mnc).

MultiBlockPlot3DReader(*args, **kwargs)

Reader for the PLOT3D format.

Nek5000Reader(*args, **kwargs)

Reader for the Nek5000 format (.nek5000).

NIFTIReader(*args, **kwargs)

Reader for the NIfTI format (.nii, .nii.gz).

NRRDReader(*args, **kwargs)

Reader for the NRRD format (.nhdr, .nrrd).

OBJReader(*args, **kwargs)

Reader for the Wavefront OBJ format (.obj).

OpenFOAMReader(*args, **kwargs)

Reader for the OpenFOAM format (.foam).

ParticleReader(*args, **kwargs)

Reader for the VTK Particle format (.raw).

PDBReader(*args, **kwargs)

Reader for the Protein Data Bank format (.pdb).

PExodusIIReader(*args, **kwargs)

Reader for the Exodus II (partitioned) format (.e.N.p, .n.N.p).

Plot3DMetaReader(*args, **kwargs)

Reader for the PLOT3D Meta format (.p3d).

PLYReader(*args, **kwargs)

Reader for the Stanford PLY format (.ply).

PNGReader(*args, **kwargs)

Reader for the PNG Image format (.png).

PNMReader(*args, **kwargs)

Reader for the PNM Image format (.pnm).

POpenFOAMReader(*args, **kwargs)

Parallel reader for the OpenFOAM format (.foam).

ProStarReader(*args, **kwargs)

Reader for the proSTAR format (.vrt).

PTSReader(*args, **kwargs)

Reader for the PTS Point Cloud format (.pts).

PVDReader(*args, **kwargs)

Reader for the ParaView Data format (.pvd).

SegYReader(*args, **kwargs)

Reader for the SEG-Y format (.segy, .sgy).

SeriesReader(*args, **kwargs)

Reader for the VTK File Series format (.series).

SLCReader(*args, **kwargs)

Reader for the SLC Volume format (.slc).

STLReader(*args, **kwargs)

Reader for the Stereolithography format (.stl).

TecplotReader(*args, **kwargs)

Reader for the Tecplot format (.dat).

ThreeDSReader(*args, **kwargs)

Reader for the 3D Studio format (.3ds).

TIFFReader(*args, **kwargs)

Reader for the TIFF Image format (.tif, .tiff).

VRMLReader(*args, **kwargs)

Reader for the VRML 2.0 format (.vrml, .wrl).

VTKDataSetReader(*args, **kwargs)

Reader for the Legacy VTK format (.vtk).

VTKPDataSetReader(*args, **kwargs)

Reader for the Legacy VTK (partitioned) format (.pvtk).

XdmfReader(*args, **kwargs)

Reader for the XDMF format (.xdmf).

XMLImageDataReader(*args, **kwargs)

Reader for the VTK ImageData format (.vti).

XMLMultiBlockDataReader(*args, **kwargs)

Reader for the VTK MultiBlock format (.vtm, .vtmb).

XMLPartitionedDataSetReader(*args, **kwargs)

Reader for the VTK PartitionedDataSet format (.vtpd).

XMLPImageDataReader(*args, **kwargs)

Reader for the VTK ImageData (partitioned) format (.pvti).

XMLPolyDataReader(*args, **kwargs)

Reader for the VTK PolyData format (.vtp).

XMLPRectilinearGridReader(*args, **kwargs)

Reader for the VTK RectilinearGrid (partitioned) format (.pvtr).

XMLPUnstructuredGridReader(*args, **kwargs)

Reader for the VTK UnstructuredGrid (partitioned) format (.pvtu).

XMLRectilinearGridReader(*args, **kwargs)

Reader for the VTK RectilinearGrid format (.vtr).

XMLStructuredGridReader(*args, **kwargs)

Reader for the VTK StructuredGrid format (.vts).

XMLUnstructuredGridReader(*args, **kwargs)

Reader for the VTK UnstructuredGrid format (.vtu).

Custom Readers#

Third-party packages can register custom readers so that pyvista.read() handles additional file formats automatically. Registration can be done programmatically or via Python entry points for zero-config discovery at install time.

register_reader(
key: str,
handler: ReaderProvider | None = None,
*,
override: bool = False,
) → Callable[[_T_Provider], _T_Provider] | None[source]#

Register a custom reader for a file extension.

Can be used as a plain call or as a decorator.

Two kinds of reader may be registered:

  • A BaseReader subclass. This is the preferred form. The class is resolved by pyvista.get_reader() exactly like a built-in reader, so keyword arguments passed to pyvista.read() set reader attributes, progress_bar and validate are honored, VTK error observers are attached, and mixins such as TimeReader and PointCellDataSelection work unchanged.

  • A bare callable handler(path, **kwargs). This is the lighter form for a format that has no reader-level state to expose. pyvista.read() calls it directly, forwarding its **kwargs; pyvista.get_reader() raises ValueError for the extension because there is no reader object to hand back. A callable registered with override=True is the exception: reader arguments for an extension PyVista already reads route to the built-in reader instead.

Added in version 0.48.0.

Changed in version 0.49.0: handler may be a BaseReader subclass.

Parameters:
keystr

A file extension (for example, '.myformat').

handlercallable() or type[pyvista.BaseReader], optional

A BaseReader subclass, or a callable with signature handler(path: str, **kwargs) that returns a pyvista.DataSet. When omitted the function acts as a decorator and returns the decorated object unchanged.

overridebool, default: False

If True, allow overriding a built-in VTK reader for this extension and silence the warning that would otherwise fire when replacing an existing custom registration. The equivalent for a plugin discovered through entry points is to declare the entry point in the pyvista.readers.override group rather than pyvista.readers.

Returns:
callable() or None

When used as a decorator (handler omitted), returns the decorated function or class. Otherwise returns None.

Raises:
ValueError

If key collides with a built-in VTK reader and override is False.

Warns:
UserWarning

If key already refers to a registered custom reader. The new registration replaces the old one (last wins); pass override=True to silence the warning.

Examples#

Download Python source code | Download Jupyter notebook

Register a reader for a custom file extension.

>>> import pyvista as pv
>>> def my_reader(path, **kwargs): ...
>>> pv.register_reader('.myformat', my_reader)

Use as a decorator.

>>> @pv.register_reader('.myotherformat')
... def my_reader(path, **kwargs): ...

Register a BaseReader subclass so that pyvista.get_reader() resolves the extension too. Where VTK has no reader for the format, BaseVTKReader supplies the parsing half.

>>> class _MyVTKReader(pv.BaseVTKReader):
...     def UpdateInformation(self): ...
...     def Update(self):
...         self._data_object = pv.PolyData()
>>> @pv.register_reader('.mybinaryformat')
... class MyReader(pv.BaseReader):
...     _class_reader = _MyVTKReader

See Also#

pyvista.register_writer

Sibling API for registering custom writers.

pyvista.registered_readers

Introspect every registered reader.

pyvista.get_reader

Resolves registered BaseReader subclasses.

registered_readers() → tuple[ReaderRegistration, ...][source]#

Return every custom reader currently registered.

Forces discovery of any pending entry-point plugins so the returned list reflects every reader visible to PyVista. A plugin that fails to import emits a UserWarning and is skipped; the rest still appear in the result.

This is the call to reach for when a built-in format reads differently than expected: a record whose override is True names the plugin that took the extension over, and its source says where that plugin came from.

Added in version 0.48.0.

Changed in version 0.49.0: Records carry reader_class and override.

Returns:
tuple[ReaderRegistration, …]

One record per registered extension. Each record exposes extension, handler, source, reader_class, and override.

Examples#

Download Python source code | Download Jupyter notebook

>>> import pyvista as pv
>>> def my_reader(path, **kwargs): ...
>>> pv.register_reader('.demo_reader', my_reader)
>>> [
...     r.extension
...     for r in pv.registered_readers()
...     if r.extension == '.demo_reader'
... ]
['.demo_reader']
class ReaderRegistration(
extension: str,
handler: ReaderProvider,
source: str,
reader_class: bool = False,
override: bool = False,
)[source]#

Describe one registered custom reader.

Returned by registered_readers().

Added in version 0.48.0.

Attributes:
extensionstr

File extension the reader is registered against, including the leading dot (for example, '.myformat').

handlercallable() or type[pyvista.BaseReader]

The reader callable, or the BaseReader subclass when the extension was registered with a reader class.

sourcestr

Human-readable origin in the form 'module.qualname' for explicit registrations or the entry-point value for plugin-discovered registrations.

reader_classbool

True when handler is a BaseReader subclass, meaning pyvista.get_reader() resolves this extension as well as pyvista.read().

Added in version 0.49.0.

overridebool

True when this reader replaces one PyVista ships, either through register_reader(..., override=True) or through the pyvista.readers.override entry-point group. Check this first when a built-in format reads differently than expected: it names the plugin that took the extension over.

Added in version 0.49.0.

Two forms of reader

A registration is either a plain callable or a pyvista.BaseReader subclass, and the choice decides how much of PyVista’s reader machinery the format gets:

Capability

Callable

BaseReader subclass

pyvista.read()

yes

yes

pyvista.get_reader()

no

yes

Keyword arguments to pyvista.read()

forwarded as handler(path, **kwargs)

set as reader attributes

progress_bar=True, validate=

ignored

honored

pyvista.TimeReader, pyvista.PointCellDataSelection

unavailable

available

A callable is the lighter option and is the right choice for a format with no reader-level state to expose. Register a pyvista.BaseReader subclass for anything a user will want to configure, step through in time, or select arrays from.

To write a reader class for a format VTK has no reader for, subclass pyvista.BaseVTKReader for the parsing and point a pyvista.BaseReader subclass at it:

import pyvista as pv


class _MyVTKReader(pv.BaseVTKReader):
    def UpdateInformation(self):
        pass

    def Update(self):
        self._data_object = _parse(self._filename)


@pv.register_reader('.myformat')
class MyReader(pv.BaseReader):
    _class_reader = _MyVTKReader

Entry points

Packages can also register readers in pyproject.toml so they are discovered automatically when installed. The entry-point value may name either a callable or a pyvista.BaseReader subclass:

[project.entry-points."pyvista.readers"]
".myformat" = "my_package:read_my_format"
".myotherformat" = "my_package:MyOtherReader"

Replacing a built-in reader

An entry point in the pyvista.readers group may only claim an extension PyVista does not already read. Claiming one it does (.vtp, .stl, .ply) would silently change what every pyvista.read() call in the environment returns, so PyVista refuses and raises ValueError naming the package, the built-in reader, and this section.

To replace a built-in reader on purpose, declare the entry point in the pyvista.readers.override group instead. The two groups are identical except that the override group is permitted to take an extension PyVista ships a reader for, and does so silently:

[project.entry-points."pyvista.readers.override"]
".vtp" = "my_package:MyPolyDataReader"

This is the entry-point equivalent of override=True on pyvista.register_reader(). Both groups accept both forms, a callable or a pyvista.BaseReader subclass.

A callable override is the one case where pyvista.read() does not forward its keyword arguments. For an extension PyVista ships a reader for, those arguments name attributes of that reader, so progress_bar, validate and any keyword argument route the read past the override to the built-in rather than being reinterpreted by the callable. Register a pyvista.BaseReader subclass to expose options on an extension PyVista already reads.

Declaring an override for an extension PyVista does not currently read is allowed and silent. It costs nothing and keeps the package working if a later PyVista release adds a reader for that extension.

Because an override changes the meaning of a format the user did not choose, it is visible from pyvista.registered_readers(): the record for the extension reports override=True along with the source that claimed it. That is the first call to make when a built-in format reads differently than expected.

import pyvista as pv

taken = [
    (r.extension, r.source)
    for r in pv.registered_readers()
    if r.override
]
# [('.vtp', 'my_package:MyPolyDataReader')]

Remote URI support

When pyvista.read() is given a remote URI (https://, s3://, etc.) and a custom reader is registered for the file extension, the URI is passed directly to the reader along with any keyword arguments. If the reader raises LocalFileRequiredError, PyVista downloads the file to a temporary local path and retries. For built-in formats with no custom reader, and for a callable override handed reader arguments, the download happens automatically. This uses fsspec when available (install with pip install pyvista[io]), falling back to pooch for HTTP(S) URIs.

class LocalFileRequiredError[source]#

Raise from a registered reader to signal it needs a local file path.

When pyvista.read() passes a remote URI to a custom reader and the reader raises this exception, PyVista will download the file to a temporary local path and retry the reader automatically.

Examples#

Download Python source code | Download Jupyter notebook

>>> import pyvista as pv
>>> from pyvista.core.utilities.reader_registry import LocalFileRequiredError
>>> @pv.register_reader('.myremoteformat')
... def my_reader(path, **kwargs):
...     if '://' in path:
...         raise LocalFileRequiredError
...     ...
has_scheme(value: str) → bool[source]#

Return True if value starts with a URI scheme (for example, https://).

Parameters:
valuestr

The string to check.

Returns:
bool

True if value contains a :// scheme prefix before the first /.

Custom Writers#

Third-party packages can register custom writers so that pyvista.DataObject.save() handles additional file formats automatically. Registration mirrors pyvista.register_reader() and supports programmatic calls, decorators, and Python entry points for zero-config discovery at install time.

register_writer(
key: str,
handler: WriterHandler | None = None,
*,
override: bool = False,
) → Callable[[WriterHandler], WriterHandler] | None[source]#

Register a custom writer for a file extension.

Can be used as a plain call or as a decorator.

Added in version 0.48.0.

Parameters:
keystr

A file extension (for example, '.myformat').

handlercallable(), optional

A callable with signature handler(dataset, path, **kwargs) that writes dataset to path. Any extra keyword arguments passed to pyvista.DataObject.save() are forwarded to the handler as **kwargs—use them to expose format-specific options such as compression level, thread count, or chunking. Handlers that do not need per-call options can omit **kwargs; a call to save() that passes extras to such a handler will raise TypeError from Python itself. When handler is omitted the function acts as a decorator and returns the decorated callable unchanged.

overridebool, default: False

If True, allow overriding a built-in PyVista writer for this extension and silence the warning that would otherwise fire when replacing an existing custom registration.

Returns:
callable() or None

When used as a decorator (handler omitted), returns the decorated function. Otherwise returns None.

Raises:
ValueError

If key collides with a built-in PyVista writer and override is False.

Warns:
UserWarning

If key already refers to a registered custom writer. The new registration replaces the old one (last wins); pass override=True to silence the warning.

Notes#

When pyvista.DataObject.save() is called, registered custom writers are dispatched before built-in VTK writers—mirroring the dispatch order of pyvista.read(). Passing override=True is therefore the only way to replace a built-in writer at save time.

Any keyword arguments passed to save() beyond its documented parameters are forwarded verbatim to the registered handler. When no custom writer is registered for the target extension, extra keyword arguments raise TypeError from save()—PyVista never silently drops writer options.

Examples#

Download Python source code | Download Jupyter notebook

Register a writer for a custom file extension with a format-specific option.

>>> import pyvista as pv
>>> def my_writer(dataset, path, *, level=3): ...
>>> pv.register_writer('.myformat', my_writer)
>>> pv.Sphere().save('sphere.myformat', level=9)

Use as a decorator.

>>> @pv.register_writer('.myformat')
... def my_writer(dataset, path, **kwargs): ...

See Also#

pyvista.register_reader

Sibling API for registering custom readers.

pyvista.registered_writers

Introspect every registered writer.

registered_writers() → tuple[WriterRegistration, ...][source]#

Return every custom writer currently registered.

Forces discovery of any pending entry-point plugins so the returned list reflects every writer visible to PyVista. A plugin that fails to import emits a UserWarning and is skipped; the rest still appear in the result.

Added in version 0.48.0.

Returns:
tuple[WriterRegistration, …]

One record per registered extension. Each record exposes extension, handler, and source.

Examples#

Download Python source code | Download Jupyter notebook

>>> import pyvista as pv
>>> def my_writer(dataset, path, **kwargs): ...
>>> pv.register_writer('.demo_writer', my_writer)
>>> [
...     r.extension
...     for r in pv.registered_writers()
...     if r.extension == '.demo_writer'
... ]
['.demo_writer']
class WriterRegistration(extension: str, handler: WriterHandler, source: str)[source]#

Describe one registered custom writer.

Returned by registered_writers().

Added in version 0.48.0.

Attributes:
extensionstr

File extension the writer is registered against, including the leading dot (for example, '.myformat').

handlercallable()

The writer callable.

sourcestr

Human-readable origin in the form 'module.qualname' for explicit registrations or the entry-point value for plugin-discovered registrations.

Handler signature

A writer handler is a callable handler(dataset, path, **kwargs) that writes dataset to path. Any extra keyword arguments passed to pyvista.DataObject.save() beyond its documented parameters are forwarded verbatim to the handler as **kwargs. Use them to expose format-specific options such as compression level, thread count, or chunking. When no custom writer is registered for the target extension, passing extra keyword arguments to save() raises TypeError; PyVista never silently drops writer options.

Entry points

Packages can register writers in pyproject.toml so they are discovered automatically when installed:

[project.entry-points."pyvista.writers"]
".myformat" = "my_package:write_my_format"

Dispatch order

When save() is called, custom writers registered via pyvista.register_writer() are dispatched before built-in VTK writers for the same extension, mirroring the dispatch order used by pyvista.read(). By default, registering a handler for an extension that collides with a built-in PyVista writer raises ValueError; pass override=True to replace the built-in writer.

The .pv Format: PyVista’s Native Binary Format#

PyVista has a native zstd-compressed binary format with the .pv extension, implemented by the pyvista-zstd companion package. It is a compact, multi-threaded format for fast dataset I/O and is included in the io extra:

pip install pyvista[io]

Once installed, .pv round-trips “just work” via the pyvista.readers and pyvista.writers entry-point hooks without any manual registration:

import pyvista as pv

mesh = pv.Sphere()
mesh.save('sphere.pv')
pv.read('sphere.pv')

Without it, both pyvista.read() and pyvista.DataObject.save() raise ImportError naming the package and the install command; see Optional Formats below.

Supported dataset types include ImageData, PolyData, StructuredGrid, RectilinearGrid, UnstructuredGrid, MultiBlock, and ExplicitStructuredGrid. The format uses zstd compression with multi-threaded encode/decode and is a good choice over .vtu / .vtp / .vtm when file size or I/O latency matters.

Optional Formats#

A few formats are served by companion packages rather than by PyVista itself, so that a heavyweight or narrowly used codec is not carried by every install. PyVista still knows the extension: pyvista.read() and pyvista.DataObject.save() dispatch to the companion package when it is installed, and raise ImportError naming the package and the install command when it is not.

Extension

Format

Direction

Package

.frd

CalculiX FRD result files

read

pyvista-frd-reader

.pv

PyVista’s native zstd-compressed format

read, write

pyvista-zstd

All of them are included in the io extra:

pip install pyvista[io]

Reading and saving are then transparent:

import pyvista as pv

mesh = pv.read('mesh.frd')
mesh.save('mesh.pv')

Without the package, the extension is still recognized: the ImportError names the format, the missing package, and both the pip install pyvista[io] command and the command for that one package on its own. When the package is present but fails to import, the error reports the import failure instead, with no install command.

These packages provide the reader object themselves, so pyvista.get_reader() does not resolve their extensions. Use the package’s own reader class when reader-level control such as time-step selection is needed:

import pyvista_frd

reader = pyvista_frd.FRDReader('mesh.frd')
reader.set_active_time_value(reader.time_values[-1])
mesh = reader.read()

The error pyvista.get_reader() raises names that class, so it says where to go: pyvista_frd.FRDReader for .frd and pyvista_zstd.Reader for .pv.

Keyword arguments beyond those save() documents are forwarded to the package’s writer, so format-specific options are reachable without a separate import:

mesh.save('mesh.pv', level=19, n_threads=4)

Changed in version 0.49.0: .frd moved from a built-in reader to pyvista-frd-reader. pyvista.FRDReader was removed; use pyvista_frd.FRDReader.

Faster Readers for Built-in Formats#

Two further companion packages read a format PyVista already supports, faster than the VTK reader does. They declare the pyvista.readers.override entry point described above, so installing one is all it takes for pyvista.read() to use it.

Extension

Format

Package

.ply

Polygon File Format

pyvista-miniply

.stl

Stereolithography

pyvista-stl

Both ship in the io-override extra, which is intentionally separate from io because installing it changes the readers used for existing formats:

pip install pyvista[io-override]

The packages aim to match the stock VTK readers, including point normals, texture coordinates, and colors, but their behavior and output are not guaranteed to be identical. Neither is required: without them pyvista.read() falls back to pyvista.PLYReader and pyvista.STLReader, which also remain what pyvista.get_reader() hands back.

Because an override changes a format the user did not choose, pyvista.registered_readers() reports it:

import pyvista as pv

[(r.extension, r.source) for r in pv.registered_readers() if r.override]
# [('.ply', 'pyvista_miniply:read_as_mesh'), ('.stl', 'pyvista_stl:read_as_mesh')]

To read a file with the VTK reader while a package is installed, use the reader class directly:

mesh = pv.STLReader('mesh.stl').read()

Added in version 0.49.0.

Writer Classes#

PyVista provides built-in writer classes for saving datasets to various file formats. These are used internally by pyvista.DataObject.save().

BaseWriter(*args, **kwargs)

The base writer class.

BMPWriter(*args, **kwargs)

Writer for the BMP Image format (.bmp).

DataSetWriter(*args, **kwargs)

Writer for the Legacy VTK format (.vtk), for any dataset.

EnSightWriter(*args, **kwargs)

Writer for the EnSight format (.case).

HDFWriter(*args, **kwargs)

Writer for the VTKHDF format (.hdf, .vtkhdf).

HoudiniPolyDataWriter(*args, **kwargs)

Writer for the Houdini Geometry format (.geo).

IVWriter(*args, **kwargs)

Writer for the Open Inventor format (.iv).

JPEGWriter(*args, **kwargs)

Writer for the JPEG Image format (.jpeg, .jpg).

NIFTIImageWriter(*args, **kwargs)

Writer for the NIfTI format (.nii, .nii.gz).

OBJWriter(*args, **kwargs)

Writer for the Wavefront OBJ format (.obj).

PLYWriter(*args, **kwargs)

Writer for the Stanford PLY format (.ply).

PNGWriter(*args, **kwargs)

Writer for the PNG Image format (.png).

PNMWriter(*args, **kwargs)

Writer for the PNM Image format (.pnm).

PolyDataWriter(*args, **kwargs)

Writer for the Legacy VTK format (.vtk), for PolyData.

RectilinearGridWriter(*args, **kwargs)

Writer for the Legacy VTK format (.vtk), for RectilinearGrid.

SimplePointsWriter(*args, **kwargs)

Writer for the XYZ Point Cloud format (.xyz).

STLWriter(*args, **kwargs)

Writer for the Stereolithography format (.stl).

StructuredGridWriter(*args, **kwargs)

Writer for the Legacy VTK format (.vtk), for StructuredGrid.

TIFFWriter(*args, **kwargs)

Writer for the TIFF Image format (.tif, .tiff).

UnstructuredGridWriter(*args, **kwargs)

Writer for the Legacy VTK format (.vtk), for UnstructuredGrid.

XMLImageDataWriter(*args, **kwargs)

Writer for the VTK ImageData format (.vti).

XMLMultiBlockDataWriter(*args, **kwargs)

Writer for the VTK MultiBlock format (.vtm, .vtmb).

XMLPartitionedDataSetWriter(*args, **kwargs)

Writer for the VTK PartitionedDataSet format (.vtpd).

XMLPolyDataWriter(*args, **kwargs)

Writer for the VTK PolyData format (.vtp).

XMLRectilinearGridWriter(*args, **kwargs)

Writer for the VTK RectilinearGrid format (.vtr).

XMLStructuredGridWriter(*args, **kwargs)

Writer for the VTK StructuredGrid format (.vts).

XMLUnstructuredGridWriter(*args, **kwargs)

Writer for the VTK UnstructuredGrid format (.vtu).

Inherited Classes#

The pyvista.BaseReader is inherited by all sub-readers. It has the basic functionality of all readers to set filename and read the data.

The PointCellDataSelection is inherited by readers that support inspecting and setting data related to point and cell arrays.

The TimeReader is inherited by readers that support inspecting and setting time or iterations for reading.

The BaseVTKReader is the base for a reader implemented in pure Python rather than by a VTK reader class. Subclass it, implement UpdateInformation and Update, and point a pyvista.BaseReader subclass at it through _class_reader. This is how pyvista.PVDReader and pyvista.GIFReader are built, and it is the supported base for a third-party reader registered with pyvista.register_reader().

The remaining classes are not used directly. They are documented because they define members shared by several readers and writers, so that each of those members is documented once and linked from every class that inherits it.

BaseReader(*args, **kwargs)

The Base Reader class.

BaseVTKReader()

Simulate a VTK reader.

core.utilities.writer._DataFormatMixin(...)

Add a data_format property to writers which support ASCII and binary output.

core.utilities.fileio._FileIOBase(*args, ...)

Base class for readers and writers, which are matched to files by extension.

PointCellDataSelection(*args, **kwargs)

Mixin for readers that support data array selections.

PVDDataSet(*args, **kwargs)

Class for storing dataset info from PVD file.

SeriesDataSet(*args, **kwargs)

Class for storing dataset info from series file.

TimeReader()

Abstract class for readers supporting time.

core.utilities.writer._XMLWriter(*args, **kwargs)

Base class for the XML writers, which also support compression.

Enumerations#

Enumerations are available to simplify inputs to certain readers.