Package API¶
The top-level gmshparser namespace contains the supported entry points, modern value types, structured errors, element metadata, and compatibility aliases most applications need.
Entry points¶
gmshparser.read(source, *, name=None)
¶
Read a path or text stream into the modern API.
Top-level :func:gmshparser.parse intentionally retains the mutable
compatibility API. Within :mod:gmshparser.api, :func:parse is an alias
for this modern reader.
Source code in gmshparser/api.py
gmshparser.parse(filename)
¶
Parse a file into the compatibility data model.
The compatibility model preserves the original get_* and set_* API.
New code should normally use :func:read, which returns the modern,
immutable model from :mod:gmshparser.api.
Source code in gmshparser/__init__.py
read() returns the modern immutable gmshparser.api.Mesh. parse() retains the original mutable gmshparser.mesh.Mesh behavior.
Package metadata¶
gmshparser.__version__ is read from the installed distribution metadata. gmshparser.__author__ identifies the package author.
Top-level modern exports¶
The following modern types are available directly from gmshparser and canonically defined in gmshparser.api:
ModernMeshVersionNodeandNodeCollectionElementandElementCollectionEntityandEntityCollectionPhysicalGroupandPhysicalGroupCollectionPeriodicLinkandPeriodicLinkCollection
See Modern API for their complete members.
Element metadata¶
The top-level namespace exports ElementType, ElementFamily, and ElementTypeInfo. They are documented with the modern model because elements and collection filters use them throughout the public API.
Errors¶
All public parser errors are available directly from gmshparser, including ParseError and its specialized subclasses. See Errors.
Compatibility exports¶
gmshparser.Mesh is the original mutable model. gmshparser.MainParser, gmshparser.MshFormatVersion, and gmshparser.VersionManager remain available for compatibility and parser development. See Compatibility API and Parser Internals.
Submodules¶
gmshparser.api— modern immutable model and modernparse()aliasgmshparser.numpy— optional NumPy conversiongmshparser.helpers— 2D visualization adapters and line parsersgmshparser.errors— structured error hierarchy