Skip to main content

pyLibMeshb

Python module to read/write mesh and solution files in Gamma Mesh Format (.mesh/.meshb/.sol/.solb). Implemented by compiling the vendored libMeshb source (libmeshb8.c / libmeshb8.h) directly and binding via Python ctypes.

PyPI distributions include precompiled shared libraries for Linux, Windows, and macOS, so most users can install with pip install pyLibMeshb without a C compiler or build toolchain. Wheels bundle the compiled libmeshb8 binary with the Python ctypes bindings, so the extension loads correctly on the host platform. If no prebuilt wheel matches your platform, pip falls back to building from source.

Getting Started

Install

pip install pyLibMeshb

Read and write mesh data

Import pyLibMeshb

import pyLibMeshb.libMeshb as lm

Check mesh information.

lm.mesh_info("naca0012.meshb")
 File          : naca0012.meshb
 Version       : 2
 Dimension     : 2
 Type                     Kind             Count   Details
 ----------------------------------------------------------------------
 vertices                 vertex            4796
 edges                    element            192
 triangles                element           9400

Read a mesh.

mesh = lm.read("naca0012.meshb")

Mesh data is stored in a dictionary with keys for each data type.

print(mesh.keys())
dict_keys(['version', 'dim', 'vertices', 'edges', 'triangles'])

Write the mesh back out.

lm.write("roundtrip.meshb", mesh)

Verify consistency.

import numpy as np
check = lm.read("roundtrip.meshb", types=["vertices"])
print("Round-trip vertices match:", np.allclose(mesh["vertices"], check["vertices"]))
Round-trip vertices match: True

Read and write solution data

Solution demo: 3 synthetic scalar fields (e.g. density, pressure, Mach).

n = mesh["vertices"].shape[0]
demo_values = np.column_stack([
    np.linspace(1.0, 2.0, n),
    np.linspace(101325.0, 90000.0, n),
    np.linspace(0.1, 3.5, n),
])
lm.write("naca0012.solb", {"version": 3, "dim": 2, "sol_at_vertices": {"values": demo_values}})

Check solution file information.

lm.mesh_info("naca0012.solb")
File          : naca0012.solb
Version       : 3
Dimension     : 2
Type                     Kind             Count   Details
----------------------------------------------------------------------
sol_at_vertices          solution          4796   sol_size=3, field_types=[1, 1, 1]

Solution data can be read using lm.read(). The mesh and solution can be visualized with Vizir4.

Query data types

Get lists of types in this mesh file.

mesh_types = lm.list_types("naca0012.meshb")
print(mesh_types)
['edges', 'triangles', 'vertices']

Get lists of types in this solution file.

solution_types =  lm.list_types("naca0012.solb")
print(solution_types)
['sol_at_vertices']

Get list of all types supported by pyLibMeshb.

all_types = lm.list_types()
print(all_types)

['corners', 'dsol_at_vertices', 'edges', 'hexahedra', 'isol_at_edges', 'isol_at_hexahedra', 'isol_at_prisms', 'isol_at_pyramids', 'isol_at_quadrilaterals', 'isol_at_tetrahedra', 'isol_at_triangles', 'isol_at_vertices', 'prisms', 'pyramids', 'quadrilaterals', 'ridges', 'sol_at_edges', 'sol_at_hexahedra', 'sol_at_prisms', 'sol_at_pyramids', 'sol_at_quadrilaterals', 'sol_at_tetrahedra', 'sol_at_triangles', 'sol_at_vertices', 'tetrahedra', 'triangles', 'vertices']

Testing

Install the package with its test dependencies and run the automated tests:

python -m pip install -e ".[test]"
python -m pytest

Credits

Metadata

Release files for pyLibMeshb 0.1.10

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

Source distribution (sdist)

Source distribution for pyLibMeshb 0.1.10
File Size Uploaded Provenance Actions
pylibmeshb-0.1.10.tar.gz 33.3 kB With provenance Details for pylibmeshb-0.1.10.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for pyLibMeshb 0.1.10
File Interpreter ABI Platform Actions
pylibmeshb-0.1.10-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for pylibmeshb-0.1.10-py3-none-win_amd64.whl
pylibmeshb-0.1.10-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details for pylibmeshb-0.1.10-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
pylibmeshb-0.1.10-py3-none-macosx_10_13_universal2.whl Python 3 none macOS 10.13+ universal2 (ARM64, x86-64) Details for pylibmeshb-0.1.10-py3-none-macosx_10_13_universal2.whl

Total release size: 187.5 kB

Release files / pylibmeshb-0.1.10.tar.gz

Download URL pylibmeshb-0.1.10.tar.gz
Size 33.3 kB
Tags Source
SHA-256 checksum
How to use checksums
e38580db31e9aab0ed35a5ef24a706cd36def652d7871ccb887e60c4039577cd
BLAKE2b-256 checksum
How to use checksums
e7c12864fd82cd92ee9f4a15b42253142a9cc602c5712ac5554be36d4f0c5cd9
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 Aug 12, 2026.

Transparency log

Release files / pylibmeshb-0.1.10-py3-none-win_amd64.whl

Download URL pylibmeshb-0.1.10-py3-none-win_amd64.whl
Size 29.7 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
cd0ef1902bc3a87c4182072a8cd7767fde06d7b687c3b6aeff1236a5c2ad33d3
BLAKE2b-256 checksum
How to use checksums
cf60f8d776a6b7c2d71475ca408ec18ebe5d4841a5af308f530df8872f5b6b99
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 Aug 12, 2026.

Transparency log

Release files / pylibmeshb-0.1.10-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL pylibmeshb-0.1.10-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 73.0 kB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
7dfb99f81972544a4e236c4aea42733fd909a441935c7c00c12bf088c457a8a6
BLAKE2b-256 checksum
How to use checksums
810c3595269a3c9e4f606208c2d4006bdfb1a237e8607cb7d694eba0290cdd36
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 Aug 12, 2026.

Transparency log

Release files / pylibmeshb-0.1.10-py3-none-macosx_10_13_universal2.whl

Download URL pylibmeshb-0.1.10-py3-none-macosx_10_13_universal2.whl
Size 51.5 kB
Tags Python 3 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
275e4478d7c0bfafc6c9e7bc969f39936ab791d61d39667acdda0da1d0b5daf3
BLAKE2b-256 checksum
How to use checksums
7b8dee1f5493cc74d0b309df603158322fbb64edcc21861ee7b720968ddca570
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 Aug 12, 2026.

Transparency log

Security for pyLibMeshb 0.1.10

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 4 files in this release have been uploaded with provenance metadata.

Select from 4 files

Attestation for pylibmeshb-0.1.10.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 Aug 12, 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