Skip to main content

No project description provided

Project description

polyxios

Fast, clean mesh I/O for Python. Read and write 3D mesh files in one line - no hidden surprises, no silent data corruption.


Install

pip install polyxios

Usage

import polyxios as px

# Read any supported format
mesh = px.read("brain.vtk")

# Inspect
print(mesh.vertices.shape)      # (n_verts, 3)
print(len(mesh.element_types))  # number of elements

# Write to a different format
px.write(mesh, "brain.ply")
px.write(mesh, "brain.vtp")

Need binary output or format-specific options?

px.write(mesh, "brain.vtk", binary=True)
px.write(mesh, "brain.ply", binary=True, endian="little")

Lazy loading - work with large files without filling RAM

For large meshes (gigabytes of binary data), pass lazy=True. polyxios memory-maps the file and only loads the pages you actually touch - the rest stays on disk until needed.

# File is opened but data is not loaded into RAM yet
mesh = px.read("huge_brain.vtk", lazy=True)

# Only the vertices are pulled from disk here
first_vertex = mesh.vertices[0]

# Element connectivity is still on disk until you access it

Lazy loading is supported for binary .vtk and .ply files. ASCII formats load eagerly (the whole file must be parsed to extract values).


Supported formats

Format Extension Read Write Lazy load
VTK Legacy .vtk binary only
VTK RectilinearGrid .vtr -
VTK PolyData .vtp -
Wavefront OBJ .obj -
Stanford PLY .ply binary only

5 formats supported - more coming via the plugin system.


Transforms

from polyxios.transforms import pipeline, merge, filter_element_type, remove_orphan_vertices

# Compose transforms into a single function
clean = pipeline(
    filter_element_type(keep="triangle"),
    remove_orphan_vertices,
)
result = clean(mesh)

# Merge two meshes into one
combined = merge(mesh_a, mesh_b)

Add your own format

Any third-party package can teach polyxios to read and write a new format - no fork required, no pull request needed.

Step 1 - write a codec (two functions, nothing more):

# mypackage/stl_codec.py
from polyxios._registry import Codec
from polyxios._types import PolyData

def read(path, *, lazy=False) -> PolyData:
    ...

def write(poly: PolyData, path, **opts) -> None:
    ...

def register():
    return ".stl", Codec(read, write)

Step 2 - declare an entry point in your pyproject.toml:

[project.entry-points."polyxios.codecs"]
stl = "mypackage.stl_codec:register"

After pip install mypackage, polyxios picks up .stl automatically - no configuration, no restart needed:

mesh = px.read("model.stl")   # works out of the box

Contributing / Development

Clone the repo, then use spin to manage the development workflow:

pip install spin
spin setup       # add upstream remote + install dev deps (libomp on macOS)
spin install     # build Cython extensions and install
spin install -e  # editable install (source changes reflected immediately)
Command Description
spin setup First-time setup: upstream remote, dev deps, OpenMP on macOS
spin build Build with Meson/ninja
spin install Regular install (compiled)
spin install -e Editable install for development
spin test Run the full test suite
spin test -k <pattern> Run tests matching a name pattern
spin lint ruff linter + formatter check + codespell
spin lint --fix Auto-fix lint and formatting issues
spin docs Build Sphinx documentation
spin docs --clean Wipe _build/ before building
spin docs --open Build and open docs in the browser
spin clean Remove build artifacts and __pycache__
spin release <version> Cut a release: bump version, tag, push, start next dev cycle

See docs/contributing.rst for commit message conventions and the full contributor guide. For the full release workflow see docs/development.rst.


Why polyxios?

  • No silent data corruption - large mesh indices raise an error instead of truncating
  • All element groups preserved - a face belonging to multiple tags stays in all of them
  • Safe on untrusted files - header counts validated before any memory allocation
  • Memory-efficient - lazy mmap loading for large binary files
  • Works without a compiler - pure Python fallbacks included; Cython hot-paths optional

License

See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

polyxios-0.2.0.tar.gz (95.1 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

polyxios-0.2.0-cp313-cp313-win_amd64.whl (548.2 kB view details)

Uploaded CPython 3.13Windows x86-64

polyxios-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (404.2 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

polyxios-0.2.0-cp313-cp313-macosx_11_0_arm64.whl (236.8 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

polyxios-0.2.0-cp312-cp312-win_amd64.whl (548.6 kB view details)

Uploaded CPython 3.12Windows x86-64

polyxios-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (403.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

polyxios-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (238.2 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

polyxios-0.2.0-cp311-cp311-win_amd64.whl (552.4 kB view details)

Uploaded CPython 3.11Windows x86-64

polyxios-0.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (407.9 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64manylinux: glibc 2.28+ x86-64

polyxios-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (237.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file polyxios-0.2.0.tar.gz.

File metadata

  • Download URL: polyxios-0.2.0.tar.gz
  • Upload date:
  • Size: 95.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for polyxios-0.2.0.tar.gz
Algorithm Hash digest
SHA256 72946efa4de943ec78f6106795c87d6c127887bb581e2fb68f631b3476030f62
MD5 e4db71c1216dd2f1696f13daa60976cb
BLAKE2b-256 6c99574f6b3ec4e18ae8ecab55d7a35e2f9fecaa798cb312aeccb3600527ff59

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyxios-0.2.0.tar.gz:

Publisher: release.yml on fury-gl/polyxios

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polyxios-0.2.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: polyxios-0.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 548.2 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for polyxios-0.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 adafa145d9d36620c4ec8add028463d8b15752bfc01ad4935b770066ad693c2f
MD5 f935112c7511cfcc54a25d1071c3b7d7
BLAKE2b-256 d8dad4be78fc028c947e7b5bae304a9211367f5128679324d0082fecb42c9ae6

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyxios-0.2.0-cp313-cp313-win_amd64.whl:

Publisher: release.yml on fury-gl/polyxios

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polyxios-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for polyxios-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 83df36c2a3ecc02cf634a3300f35a794082ea031d5bea8847f1cc71fa41e06d6
MD5 517ff5ad4791ed4a7f77bb6a6da0102d
BLAKE2b-256 99920197fdd2fbd3c99bf64171745d932a08dcc24f13e9a001f75971047ff5e7

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyxios-0.2.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on fury-gl/polyxios

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polyxios-0.2.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polyxios-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5b005639916aea84166b4991f7de44a71d7f7cdb9828a7b2948d56656187f96f
MD5 ef006390af1a964ba8a66438b8223fac
BLAKE2b-256 ccd034737c72ed713172286accc0d775ffcd59f067b960cd1f9dc4061e3b9103

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyxios-0.2.0-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: release.yml on fury-gl/polyxios

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polyxios-0.2.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: polyxios-0.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 548.6 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for polyxios-0.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 472cc33d3e7a0c214f2aa9cb23b5ae2518a22c6473d6efc99709d1b086c9a08a
MD5 0b07bb96e90a1fd588083ec8cc900178
BLAKE2b-256 3282ffe22498ff86f0b0edd4db023c7c13cf661ec97a759ab70b49d575c1552b

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyxios-0.2.0-cp312-cp312-win_amd64.whl:

Publisher: release.yml on fury-gl/polyxios

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polyxios-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for polyxios-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8dc4ea20b168df1585bc205daddc747f575e28176f4bd8876bcfc259aaa1f4e1
MD5 4ef9b7c3f982bbddbd4ea32133a71a24
BLAKE2b-256 086832244349f3751fedce4ca0601b6d7b62127fa81b9a2224658fb6269a30df

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyxios-0.2.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on fury-gl/polyxios

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polyxios-0.2.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polyxios-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d96ddd3d070193943e0936bbcf6f10e291b4171a0a4e1868bfe55cd12be9d605
MD5 d669fec7ede7ea86e10ea7b796a1aed5
BLAKE2b-256 552fcc7bc20cf7d2c50ec4f57164f3337fa1abad3ac59b4241ab45a788d357ba

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyxios-0.2.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on fury-gl/polyxios

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polyxios-0.2.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: polyxios-0.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 552.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for polyxios-0.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 ffd2a0c84f2315e5165b2949ec694ba4374e9e915696842e1d6e1040a9370263
MD5 feeefffaa62058092a46b31ce8cde938
BLAKE2b-256 7d689eb69629defa0251d0a596dab4b95278e71ea585ab3d2a21093031d979f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyxios-0.2.0-cp311-cp311-win_amd64.whl:

Publisher: release.yml on fury-gl/polyxios

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polyxios-0.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for polyxios-0.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 032169c269e5b47e1615cfb7e2115f29a4cda3feb649f28d30f332ab6aed4382
MD5 c9fdd7c12a7f846702a7486326eb3494
BLAKE2b-256 5e2707c84e048fc6d532d62db2b97157cc8e82f0167d9827330e76da44312c40

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyxios-0.2.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release.yml on fury-gl/polyxios

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file polyxios-0.2.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for polyxios-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7ea6f3a95b9662f9c8f09d7b6fce8cb961e1a3e3b0458d9090b15f778d16c73d
MD5 db2aa83d16b749ee4c71d0ddfa0578ac
BLAKE2b-256 e06f276fc541801ff6272777836a1905a96fc814b8312a02e5f6e244b0e45eb1

See more details on using hashes here.

Provenance

The following attestation bundles were made for polyxios-0.2.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on fury-gl/polyxios

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page