# How to extract data from .pvtr in python?

**URL:** https://discourse.paraview.org/t/how-to-extract-data-from-pvtr-in-python/2008
**Category:** ParaView Support
**Tags:** python
**Created:** [June 8, 2019, 10:15pm UTC](https://discourse.paraview.org/t/how-to-extract-data-from-pvtr-in-python/2008 "2019-06-08T22:15:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Vis](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/v/85e7bf/32.png) [@Vis](https://discourse.paraview.org/u/Vis)
#### Post date: [June 8, 2019, 10:15pm UTC](https://discourse.paraview.org/t/how-to-extract-data-from-pvtr-in-python/2008/1 "2019-06-08T22:15:25Z")

</div>

I have a 2D CFD field, 10+ variables stored in space at point. I want the data as a 2D numpy array in python from a given .pvtr file.

I have tried using vtk python library. Kernal crashes as soon as I try and access the data. I am not sure why. The .pvtr files are written by vtkXMLParallelRectilinearWriter in Fortran, XML version 0.1.

However, Paraview GUI is able to read and 2D plot the data, just fine!  
So, I tried using paraview python library to extract the data. I used paraview’s servermanager module and Fetch method. This also crashed, like the python vtk libraries.

Clearly, Paraview GUI can read my data correctly. Are there alternative (not using Fetch) ways I can retrieve data arrays from .pvtr files using Paraview’s library in python ?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [June 10, 2019, 8:09am UTC](https://discourse.paraview.org/t/how-to-extract-data-from-pvtr-in-python/2008/2 "2019-06-10T08:09:54Z")

</div>

vtkPython should work for your usecase. Mind sharing your data ?
