{"library":"pyevtk","title":"Python EVTK Library","description":"pyevtk is a Python library for exporting numerical data (like structured grids, unstructured grids, and points) into binary VTK (Visualization Toolkit) files, enabling visualization in tools like ParaView or VisIt. As of version 1.6.0, it supports various data types and has an active, albeit slow, release cadence.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install pyevtk"],"cli":null},"imports":["from pyevtk.hl import gridToVTK","from pyevtk.hl import pointsToVTK","from pyevtk.hl import imageToVTK"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import numpy as np\nfrom pyevtk.hl import gridToVTK\n\n# Define grid dimensions\nnx, ny, nz = 64, 64, 64\n\n# Coordinates\nx = np.arange(0, nx, 1, dtype='float64')\ny = np.arange(0, ny, 1, dtype='float64')\nz = np.arange(0, nz, 1, dtype='float64')\n\n# Cell data (e.g., temperature)\ntemp = np.random.rand(nx - 1, ny - 1, nz - 1)\n\n# Point data (e.g., pressure)\npress = np.random.rand(nx, ny, nz)\n\n# Export to VTK file\ngridToVTK(\n    \"output_grid\",\n    x, y, z,\n    cellData={'temperature': temp},\n    pointData={'pressure': press}\n)\n\nprint(\"VTK file 'output_grid.vts' generated successfully.\")","lang":"python","description":"This quickstart demonstrates how to export a structured grid with both cell-centered and point-centered data to a VTK Structured Grid (.vts) file using `gridToVTK`.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}