VTK Gradient Filter

If you are using Python, I highly recommend using PyVista: https://docs.pyvista.org which is a more Pythonic interface to VTK. And it has some more documentation on how to use the gradient filter:

see also: Gradient of Unstrucutred Grid in Python