Skip to main content

geoh5vista: a Geoh5 <> PyVista (VTK) interface

A PyVista (and VTK) interface for the Geoh5 file format providing Python 3D visualization and useable data structures for processing datasets in the geoh5 specification. This library allows geologists to access the powerful tools available in the PyVista ecosystem for their data stored in the Geoh5 format.

The structure and interfaces of this project are heavily inspired by the 'omfvista' package, which provides a similar interface for the 'omf' format.

omfvista package: https://github.com/OpenGeoVis/omfvista

Geoh5 Python interface package: https://mirageoscience-geoh5py.readthedocs-hosted.com/en/stable/index.html

Documentation is hosted at https://github.com/derek-kinakin/geoh5vista

Installation

From PyPI

pip install geoh5vista

From Github

pip install git+https://github.com/derek-kinakin/geoh5vista.git

Current Status of Supported Geoh5 Entities

This table provides the list of supported entities. Read from and write to Geoh5 support is the goal for each entity.

Geoh5 Entity PyVista Object Read from Geoh5 Write to Geoh5 Notes
Workspace MultiBlock Yes Yes A multiblock containing several object can be written to Geoh5
Points PointSet Yes Yes
Curve PolyData Yes Yes
Surface PolyData Yes Yes
2D Grid ImageData Yes Yes 2D grid with dimensions nU x nV x 1
Block model ImageData Yes Yes Uniform spacing within each axis; 3D grid with dimensions nU x nV x nZ
Drillholes PolyData Yes No Drillholes can be round-tripped back to geoh5 as curves
Slicer PolyData Yes No Geometry available as object metadata

Block models may use different spacing for U, V, and Z, but spacing must be uniform within each axis. Variable-spacing block models and StructuredGrid exports are unsupported and raise explicit errors. The earlier StructuredGrid block-model implementation has been removed, including blockmodel_grid_geom_to_structured_vtk; use blockmodel_to_vtk or blockmodel_grid_geom_to_image_vtk for supported models.

Block-model imports preserve rotation, nonzero delimiter offsets, and descending-axis cell-data alignment. ImageData uses the transformed first delimiter corner as its origin, positive spacing, and signed axis directions. The geometry helper applies no rotation when rotation_matrix=None; blockmodel_to_vtk applies the model's rotation automatically.

Block-model exports preserve horizontal rotation, signed axis directions, and cell-data alignment. Tilted, sheared, or scaled direction matrices are rejected. Export normalizes delimiters to start at zero and moves their offset into the model origin. A reversed U axis is represented by an equivalent rotation and signed V spacing, so geometry and data are preserved, but the original origin, delimiter offsets, and rotation representation may differ after a round trip.

Geoh5 Entity Metadata Support

The following metadata are read from the geoh5 entities and attached to the PyVista objects in the "user_dict":

  • Entity name (ob.user_dict["gh5_name"]) as a string
  • Entity colour (ob.user_dict["gh5_colour"]) as a list [R,G,B]
  • Entity type (ob.user_dict["gh5_entity_type"]) as "Points", "Curve", "Surface", "Grid2D", "Grid3D", or "Drillhole"
  • Entity visibility (ob.user_dict["gh5_visible"]) as True/False. Integer/NumPy visibility values from geoh5py are normalized (0 = hidden); unrecognized values are treated as visible with a warning.

Example Use

import pyvista as pv
import geoh5vista

project = geoh5vista.read_geoh5('test_file.geoh5')
project

Once the data is loaded as a pyvista.MultiBlock dataset from geoh5vista, that object can be directly used for interactive 3D visualization from PyVista:

An interactive scene can be created and manipulated to create a figure. First, grab the elements from the project:

# Grab a few elements of interest and plot em up!
vol = project["Block Model"]
topo = project["Topography"]
dacite = project["Dacite"]

Then create a 3D scene with these spatial data and apply a filtering tool from PyVista to the volumetric data:

# Create a plotting window
p = pv.Plotter(notebook=False)
# Add our datasets
p.add_mesh(topo, cmap="gist_earth", opacity=0.5)
p.add_mesh(dacite, color=dacite.user_dict["gh5_colour"], opacity=0.6)
# Add the volumetric dataset with a thresholding tool
p.add_mesh_threshold(vol)
# Add the bounds axis
p.show_bounds()
# Render the scene in a pop out window
p.show()

Writing PyVista objects to a Geoh5 file can be as simple as:

# Write a single object to geoh5
geoh5vista.write_geoh5(topo, "new_gh5_topo_file.geoh5")

# Write a multiblock to geoh5
new_project = pv.MultiBlock()
new_project["Topo"] = topo
new_project["Dacite"] = dacite

geoh5vista.write_geoh5(new_project, "new_project.geoh5")

Metadata

Release files for geoh5vista 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geoh5vista 0.4.0
File Size Uploaded
geoh5vista-0.4.0.tar.gz 26.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for geoh5vista 0.4.0
File Interpreter ABI Platform
geoh5vista-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 51.6 kB

Release files / geoh5vista-0.4.0.tar.gz

Download URL geoh5vista-0.4.0.tar.gz
Size 26.9 kB
Tags Source
SHA-256 checksum
How to use checksums
cc4cecad52737f84a8d370296e7692827a3ea40e4c1ce3224f35b7f6e6597b42
BLAKE2b-256 checksum
How to use checksums
26055e4b7e6520ea0fc64ea7e0e5108bb86f9e36f2b6e379c296a3cc8219e1a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / geoh5vista-0.4.0-py3-none-any.whl

Download URL geoh5vista-0.4.0-py3-none-any.whl
Size 24.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fbe2b916b40c342ba54ae8f298ab2a2b6cdd148f091b3b2ac8c364ec3965eb0a
BLAKE2b-256 checksum
How to use checksums
c0f0f3fb5959c919c71db2544800715365246cede6f8a4f78b984a4a17b6f8e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.1

2 release files

0.6.0

2 release files

0.5.0

2 release files

This release

0.4.0 This release

2 release files

0.3.5

2 release files

0.3.1

2 release files

0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page