# Confusion about using the PVD reader from Python

**URL:** https://discourse.paraview.org/t/confusion-about-using-the-pvd-reader-from-python/17658
**Category:** ParaView Support
**Tags:** python
**Created:** [July 13, 2026, 9:11am UTC](https://discourse.paraview.org/t/confusion-about-using-the-pvd-reader-from-python/17658 "2026-07-13T09:11:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/csatizoltan/32/6997_2.png) [@CsatiZoltan](https://discourse.paraview.org/u/CsatiZoltan)
#### Post date: [July 13, 2026, 9:11am UTC](https://discourse.paraview.org/t/confusion-about-using-the-pvd-reader-from-python/17658/1 "2026-07-13T09:11:13Z")

</div>

I want to read a .pvd file from within a Python algorithm, and pass the underlying object (in my case a `vtkMultiBlockDataSet`) to an output port of my filter. So that my plugin be self-contained, I do not open the file with the pvd reader and then connect its output to the input port of my filter, but I read the pvd file directly from within the `RequestData` method of my filter class. Nevertheless, the code written below in `>>>` is equally valid in pvpython or the Python Shell of the ParaView GUI. Actually this is how I tested them. My data is time-dependent and the problem is that only the first time step is read.

## Approach 1

One way to read a pvd file is via the `vtkPVDReader` class:

```python
>>> from paraview.modules.vtkPVVTKExtensionsIOCore import vtkPVDReader
>>> reader = vtkPVDReader()
>>> reader.SetFileName('<path_to_my_file.pvd>')
>>> reader.Update()
>>> reader.GetNumberOfTimeSteps()
0
>>> reader.GetTimeStepRange()
(0, 0)

```

It doesn’t read all the time steps, only the first one. When I use it from within the `RequestData` method of my Python algorithm class, I feed it to output port 1:

```python
outInfo = outInfoVector.GetInformationObject(1)
output1 = outInfo.Get(vtkDataObject.DATA_OBJECT())
output1.ShallowCopy(reader.GetOutputDataObject(0))

```

ParaView then only shows the mesh for the first time step. How can I get the meshes for all the time steps?

## Approach 2

Next, I tried to use `PVDReader` from `paraview.simple`, although this is not recommended in an algorithm.

```python
>>> reader2 = PVDReader(FileName='<path_to_my_file.pvd>')

```

Again, ParaView displays the first time step only in the toolbar. By the way, `PVDReader` seems to be a wrapper around `vtkPVDReader`:

```python
>>> type(reader2.SMProxy.GetClientSideObject())
<class 'paraview.modules.vtkPVVTKExtensionsIOCore.vtkPVDReader'>

```

## Approach 3

Drag & drop my .pvd file into the ParaView GUI. Then it properly reads the time steps. However, what surprises me is that the Python trace generated with it provides the same command as in Approach 2 above, which apparently didn’t read the time steps.

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [July 23, 2026, 8:41pm UTC](https://discourse.paraview.org/t/confusion-about-using-the-pvd-reader-from-python/17658/2 "2026-07-23T20:41:51Z")

</div>

Approach 1 is the way to go as we discussed at the ParaView Office Hours. You’ll need to implement `RequestionInformation` in your Python algorithm plugin and populate the timesteps from the timesteps read by the `vtkPVDReader`, which you can get with

```auto
from paraview.vtk.vtkCommonExecutionModel import vtkStreamingDemandDrivenPipeline
reader.GetExecutive().GetOutputInformation(0).Get(vtkStreamingDemandDrivenPipeline.TIME_STEPS())

```

---

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/csatizoltan/32/6997_2.png) [@CsatiZoltan](https://discourse.paraview.org/u/CsatiZoltan)
#### Post date: [July 27, 2026, 10:51am UTC](https://discourse.paraview.org/t/confusion-about-using-the-pvd-reader-from-python/17658/3 "2026-07-27T10:51:51Z")

</div>

Thank you. With your code, I can get the correct time steps read by the PVD reader. In `RequestInformation`, I set the time steps obtained this way:

```python
# Read a PVD file
from paraview.vtk.vtkCommonExecutionModel import vtkStreamingDemandDrivenPipeline
reader = vtkPVDReader()
reader.SetFileName(path)
reader.Update()
self.multiblock_dataset = reader.GetOutputDataObject(0)
time_steps = reader.GetExecutive().GetOutputInformation(0).Get(vtkStreamingDemandDrivenPipeline.TIME_STEPS())
# Remove the previous time steps
outInfo = outInfoVector.GetInformationObject(0)
executive = self.GetExecutive()
outInfo.Remove(executive.TIME_STEPS())
outInfo.Remove(executive.TIME_RANGE())
# Add the new time steps
for t in time_steps:
    outInfo.Append(executive.TIME_STEPS(), t)
outInfo.Append(executive.TIME_RANGE(), time_steps[0])
outInfo.Append(executive.TIME_RANGE(), time_steps[-1])

```

In `RequestData`, I copy the multiblock dataset to output port 1 of my reader:

```python
outInfo = outInfoVector.GetInformationObject(1)
output1 = outInfo.Get(vtkDataObject.DATA_OBJECT())
output1.ShallowCopy(self.multiblock_dataset)

```

ParaView shows the correct time steps at the top, but the multiblock dataset (which is time dependent) stays the same for any time step (having the value from the first time step).

---

<div class="post-metadata">

### Author: ![cory.quammen](https://discourse.paraview.org/user_avatar/discourse.paraview.org/cory.quammen/32/11193_2.png) [@cory.quammen](https://discourse.paraview.org/u/cory.quammen)
#### Post date: [August 6, 2026, 6:57pm UTC](https://discourse.paraview.org/t/confusion-about-using-the-pvd-reader-from-python/17658/4 "2026-08-06T18:57:27Z")

</div>

In `RequestData`, you are going to need to pass the requested time step to `vtkPVDReader` so that it reads the dataset at the time your custom reader requests. You should be able to do this by setting the `UPDATE_TIME_STEP()` information key in the output information for `vtkPVDReader`, which you can hack in with

```auto
exec = reader.GetExecutive()
io = exec.GetOutputInformation().GetInformationObject(0)
io.Set(vtkStreamingDemandDrivenPipeline.UPDATE_TIME_STEP(), timestep)
reader.Update()

```

By the way, in your `RequestInformation`, you’ll probably want to call `reader.UpdateInformation()` rather than `reader.Update()`. The former should only read metadata from the .pvd file while `Update()` will read the entire file.
