Custom PyCharm docstring stubs (i.e. for google docstring or numpydoc formats)

PythonPycharmDocstringDoctestSphinx Napoleon

Python Problem Overview


Does PyCharm 2.7 (or will PyCharm 3) have support for custom docstring and doctest stubs? If so, how does one go about writing this specific type of custom extension?

My current project has standardized on using the Google Python Style Guide (http://google-styleguide.googlecode.com/svn/trunk/pyguide.html). I love PyCharm's docstring support, but it's only two supported formats right now are epytext and reStructureText. I want, and am willing to write myself, a PyCharm plugin that creates a documentation comment stub formatted in either Google or Numpydoc style (https://pypi.python.org/pypi/sphinxcontrib-napoleon/). Of special importance here is incorporating the type inference abilities that PyCharm has with the other two documentation types.

Python Solutions


Solution 1 - Python

With PyCharm 5.0 we finally got to select Google and NumPy Style Python Docstrings templates.

It is also mentioned in the [whatsnew][2] section for PyCharm 5.0.

How to change the Docstring Format:

> File --> Settings --> Tools --> Python Integrated Tools

There you can choose from the available Docstrings formats:

> Plain, Epytext, reStructuredText, NumPy, Google

[2]: https://www.jetbrains.com/pycharm/whatsnew/ "whatsnew"

As pointed out by jstol: for Mac users, this is under > PyCharm -> Preferences -> Tools -> Python Integrated Tools.

Solution 2 - Python

As CrazyCoder mentions, its a ticket. Right now, you can only use EpyType and reStructuredText.

Solution 3 - Python

Just to be make @Nras answer explicit, as of PyCharm 5.0:

> File > Settings > Tools > Python Integrated Tools > Docstrings > > Google

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionkalefranzView Question on Stackoverflow
Solution 1 - PythonNrasView Answer on Stackoverflow
Solution 2 - PythonGames BrainiacView Answer on Stackoverflow
Solution 3 - PythonKamil SindiView Answer on Stackoverflow