meshRW is a Python module that proposes basic readers and writers for msh (gmsh) and vtk (Paraview).
Project description
meshRW
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 withconnectivity,type, and optionalphysgrp.fields: list of dictionaries withname,type(nodal/elemental),dim,data, and optional time metadata (nbsteps,steps).
Format notes
.msh: usemeshRW.msh(legacy) ormeshRW.msh2(Gmsh API-backed, version options)..vtk: usemeshRW.vtk(legacy writer)..vtu/.pvd: usemeshRW.vtk2for XML and transient outputs.
Documentation
- Hosted documentation on Read the Docs: meshrw.readthedocs.io
- Project docs index: docs/index.md
- Getting started: docs/getting-started.md
- API overview: docs/api-overview.md
- Format support: docs/format-support.md
- Development guide: docs/development.md
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file meshrw-1.6.1.tar.gz.
File metadata
- Download URL: meshrw-1.6.1.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d2be497b208077f60b8ec74c088a7a1551b131d775851411da4233d5445a691a
|
|
| MD5 |
5d84e9676c36a12ea16f6427c2104b31
|
|
| BLAKE2b-256 |
3957798cb9eebfab665edd9af204a4736d9d4252b936e1ea4bd162d443b521ea
|
Provenance
The following attestation bundles were made for meshrw-1.6.1.tar.gz:
Publisher:
CI-publish.yml on luclaurent/meshRW
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meshrw-1.6.1.tar.gz -
Subject digest:
d2be497b208077f60b8ec74c088a7a1551b131d775851411da4233d5445a691a - Sigstore transparency entry: 2057511227
- Sigstore integration time:
-
Permalink:
luclaurent/meshRW@77c679eec0d3f543ed70319319992bd6e32fb287 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/luclaurent
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI-publish.yml@77c679eec0d3f543ed70319319992bd6e32fb287 -
Trigger Event:
workflow_run
-
Statement type:
File details
Details for the file meshrw-1.6.1-py3-none-any.whl.
File metadata
- Download URL: meshrw-1.6.1-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a24ecc77e28e5c78c4df91ee5d45906add2eeb0a19795b18d3ba8e59ab9dcb8
|
|
| MD5 |
264fe63ee771bf00057d1077c7ffcf0b
|
|
| BLAKE2b-256 |
7369aba583d8557dcc603ca51491303237323df141bd5430c0a1550e1275c2f4
|
Provenance
The following attestation bundles were made for meshrw-1.6.1-py3-none-any.whl:
Publisher:
CI-publish.yml on luclaurent/meshRW
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
meshrw-1.6.1-py3-none-any.whl -
Subject digest:
8a24ecc77e28e5c78c4df91ee5d45906add2eeb0a19795b18d3ba8e59ab9dcb8 - Sigstore transparency entry: 2057511605
- Sigstore integration time:
-
Permalink:
luclaurent/meshRW@77c679eec0d3f543ed70319319992bd6e32fb287 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/luclaurent
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI-publish.yml@77c679eec0d3f543ed70319319992bd6e32fb287 -
Trigger Event:
workflow_run
-
Statement type: