pythonconvertersdocstring

How do I convert Python docstrings to a different style?


I am working on a codebase which uses Google style Python docstrings, and I would like to convert them automagically to numpy style.

Is there an automatic tool for doing so?

A quick Google search reveals pyment, but I'm not sure if that's appropriate.


Solution

  • pyment definitely looks like the tool for the job as it states it can convert between numpydoc and google docstrings in both directions.

    Currently, the managed styles in input/output are javadoc, one variant of reST (re-Structured Text, used by Sphinx), numpydoc, google docstrings, groups (other grouped style).