Docs for python wrapper

Does anyone know where I can find the docs for the VTK Python wrapper? I can only find docs for the C++ version and installation instructions for the python wrapper!

1 Like

The C++ API reference is functional (since class and method names are the same), there are also tons of Python examples, and you can always get Python-style documentation of any VTK class or method by using help command in the Python console - so the situation is not so bad now. But it would be indeed very nice to have proper Python-style API reference.

@dgobbi would it be possible to generate Python skeleton files (.py files that contains classes with their methods and documentation but with empty implementation)? It could be fed into Sphinx to generate Python documentation (and may help some of the Python IDEs with auto-complete and documentation). PyCharm can generate skeletons from binaries (https://github.com/JetBrains/python-skeletons) but it seems to be deprecated. Do you have any other idea?

1 Like

The C++ docs don’t cover everything, for instance they don’t even mention the numpy interface.

I did some work in November on generating PyCharm compatible docstrings for .pyi stub files, and plan to finish the work sometime next month, but I don’t know if sphinx can use .pyi files (I don’t know if sphinx can handle @overload, and VTK has lots of overloaded methods).

1 Like

It seems that sphinx documentation generator from code does not support @overload. So, generating documentation from Python stub may not be ideal.

Breathe can generate Sphinx input from doxygen XML and it seems to support @overload. An option may be to generate C++ API documentation using doxygen, then run breathe+sphinx to generate Python API documentation.

1 Like