# Can a Python plugin access Paraview's progress bar?

**URL:** https://discourse.paraview.org/t/can-a-python-plugin-access-paraviews-progress-bar/16352
**Category:** ParaView Support
**Tags:** python
**Created:** [March 18, 2025, 12:44pm UTC](https://discourse.paraview.org/t/can-a-python-plugin-access-paraviews-progress-bar/16352 "2025-03-18T12:44:10Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![florezg](https://discourse.paraview.org/user_avatar/discourse.paraview.org/florezg/32/15983_2.png) [@florezg](https://discourse.paraview.org/u/florezg)
#### Post date: [March 18, 2025, 12:44pm UTC](https://discourse.paraview.org/t/can-a-python-plugin-access-paraviews-progress-bar/16352/1 "2025-03-18T12:44:10Z")

</div>

Is there a way for a plugin, i.e., a class that inherits from “VTKPythonAlgorithmBase” to access Paraview’s (status bar) progress bar widget. The class vtkAlgorithm has the methods “SetProgressShiftScale”, “SetProgressText”, etc., for instance. However if you call them from a plugin they seem not to anything. The idea is to provide some interactivity, i.e., progress, while the plugin reads large input files that can take minutes to load. Is there an example consuming these methods (C++ or Python)? Thanks.

---

<div class="post-metadata">

### Author: ![Christos\_Tsolakis](https://discourse.paraview.org/user_avatar/discourse.paraview.org/christos_tsolakis/32/4450_2.png) [@Christos\_Tsolakis](https://discourse.paraview.org/u/Christos_Tsolakis)
#### Post date: [March 18, 2025, 8:22pm UTC](https://discourse.paraview.org/t/can-a-python-plugin-access-paraviews-progress-bar/16352/2 "2025-03-18T20:22:34Z")

</div>

Hi @florezg and welcome to ParaView’s discourse !

Yes you can access the progress bar by using using the API you mentioned. Here is an example:

```auto
from paraview.util.vtkAlgorithm import (
    VTKPythonAlgorithmBase,
    smproxy,
    smproperty,
    smdomain,
)

from time import sleep

@smproxy.filter(name="Test progress")
@smproperty.input(name="Input") 
@smdomain.datatype( dataTypes=["vtkUnstructuredGrid"],
) 
class TestProgress(VTKPythonAlgorithmBase):
    def __init__ (self):
        super(). __init__ (
            nInputPorts=1, nOutputPorts=1, outputType="vtkUnstructuredGrid"
        )
        self.SetProgressText("Test Progress")

    def RequestData(self, request, inInfo, outInfo):

        # init step takes 10%
        sleep(2)
        self.UpdateProgress(0.1)

        # loop takes 80%, i.e. from 10%->90%
        self.SetProgressShiftScale(0.1,0.9)
        for i in range(10):
          self.UpdateProgress(i/10);
          sleep(1)

        # reset scale
        self.SetProgressShiftScale(0,1.0)
        # final takes 10%
        self.UpdateProgress(1.0)
        sleep(1)

        return 1 

```

---

<div class="post-metadata">

### Author: ![florezg](https://discourse.paraview.org/user_avatar/discourse.paraview.org/florezg/32/15983_2.png) [@florezg](https://discourse.paraview.org/u/florezg)
#### Post date: [March 19, 2025, 4:29am UTC](https://discourse.paraview.org/t/can-a-python-plugin-access-paraviews-progress-bar/16352/3 "2025-03-19T04:29:08Z")

</div>

Thanks for the help! It does the trick. Best regards.
