Dataset Accessors

Dataset Accessors#

PyVista exposes a pandas/xarray-style accessor mechanism so that third-party packages can add namespaced filter methods to dataset classes without monkey-patching or subclassing. Once a plugin module is imported, its accessor becomes available on every instance of the target class as dataset.<namespace>.<method>(...) and chains seamlessly with built-in PyVista filters.

See Extending PyVista for a full guide with a worked example and guidance on typing and autocomplete.

register_dataset_accessor(name, target_cls, *)

Register a custom namespaced accessor on a PyVista dataset class.

unregister_dataset_accessor(name, target_cls)

Remove an accessor previously attached to a target class.

registered_accessors()

Return every accessor currently registered.

AccessorRegistration(name, target, accessor, ...)

Describe one registered dataset accessor.

DataSetAccessor(dataset)

Structural protocol for third-party accessor classes.