Skip to main content

meshRW

GitHub PyPI release DOI CI tests code coverage Documentation

meshRW is a lightweight Python library to read/write mesh files for Gmsh and VTK-based workflows.

What it provides

  • Read legacy Gmsh meshes (.msh, v2.2).
  • Write Gmsh meshes (.msh) with static or transient fields.
  • Write legacy VTK (.vtk) and XML VTK (.vtu + .pvd) outputs.
  • Export nodal and elemental data, including time-series results.

Installation

pip install meshRW

For contributors (lint + docs tooling):

pip install -e .[dev,docs]

Quick start

Read a Gmsh mesh

from meshRW import msh

mesh = msh.mshReader(filename="input.msh", dim=3)
nodes = mesh.getNodes()
elements = mesh.getElements(dictFormat=True)

Write a VTK/VTU result

from meshRW import vtk2

vtk2.vtkWriter(
    filename="output.vtu",
    nodes=nodes,
    elements=elements,
    fields=[],
)

Writer input model

Writers share the same core data model:

  • nodes: array-like (n_nodes, 2|3).
  • elements: a dictionary or list of dictionaries with connectivity, type, and optional physgrp.
  • fields: list of dictionaries with name, type (nodal/elemental), dim, data, and optional time metadata (nbsteps, steps).

Format notes

  • .msh: use meshRW.msh (legacy) or meshRW.msh2 (Gmsh API-backed, version options).
  • .vtk: use meshRW.vtk (legacy writer).
  • .vtu / .pvd: use meshRW.vtk2 for XML and transient outputs.

Documentation

Development and quality

  • Tests: pytest meshRW/tests -q
  • Lint: ruff check meshRW
  • Docs build: sphinx-build -W --keep-going -b html docs docs/_build/html

See CONTRIBUTING.md for the full workflow.

Related projects

License

This project is licensed under the MIT License. See LICENSE.

Metadata

Release files for meshRW 1.6.1

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

Source distribution (sdist)

Source distribution for meshRW 1.6.1
File Size Uploaded Provenance
meshrw-1.6.1.tar.gz 1.7 MB With provenance Details

Built distribution (wheel)

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

Total release size: 3.5 MB

Release files / meshrw-1.6.1.tar.gz

Download URL meshrw-1.6.1.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
d2be497b208077f60b8ec74c088a7a1551b131d775851411da4233d5445a691a
BLAKE2b-256 checksum
How to use checksums
3957798cb9eebfab665edd9af204a4736d9d4252b936e1ea4bd162d443b521ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 3, 2026.

Transparency log

Release files / meshrw-1.6.1-py3-none-any.whl

Download URL meshrw-1.6.1-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
8a24ecc77e28e5c78c4df91ee5d45906add2eeb0a19795b18d3ba8e59ab9dcb8
BLAKE2b-256 checksum
How to use checksums
7369aba583d8557dcc603ca51491303237323df141bd5430c0a1550e1275c2f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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 Jul 3, 2026.

Transparency log

Security for meshRW 1.6.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for meshrw-1.6.1.tar.gz

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 Jul 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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