// read_anything()
Reading 3D meshes in Python normally means installing one library per format. polyxios is a single small, maintained package that reads and writes all twenty-five - and raises instead of quietly corrupting your data.
import polyxios as px mesh = px.read("brain.vtk") mesh.vertices.shape # (n, 3) len(mesh.element_types) # 2 px.write(mesh, "brain.ply") px.write(mesh, "brain.stl", binary=True) # gigabytes? memory-map it mesh = px.read("huge.vtk", lazy=True)█
01 // formats
Every format carries its own page: what the specification says, what polyxios does with it, and a link to the authoritative document.
} // 25 codecs, 34 extensions
02 // guarantees
[00]
Large mesh indices raise an error instead of quietly truncating to a narrower integer.
[01]
A face belonging to several tags stays in all of them, through a full read-write round trip.
[02]
Header counts are validated before any memory is allocated for the body.
[03]
Pure Python fallbacks ship with the package; the Cython hot-paths are optional.
03 // cli
Ships with the package. Pull a catalogued model, convert it, and render it through FURY without writing a script.
$ pxios fetch bunny.obj cached -> ~/.polyxios/bunny.obj (2.9 MB) $ pxios convert bunny.obj bunny.vtk 35947 vertices · 69451 triangles · 0.4s $ pxios list --codecs .avs .bdf .ele .f3grid .inp .meshb .msh .obj .off .ply .stl .su2 .tec .vtk .vtp .vtr .wkt .xml $ pxios viz bunny.vtk --points█
04 // plugins
Any third-party package can teach polyxios a nineteenth format. Two functions and an entry point - no fork, no pull request, no restart.
from polyxios._registry import Codec def read(path, *, lazy=False): ... def write(poly, path, **opts): ... def register(): return ".abc", Codec(read, write)
[project.entry-points."polyxios.codecs"] abc = "mypackage.abc_codec:register" # then, anywhere: mesh = px.read("model.abc") # picked up automatically