What is out there on conventions and tools for documenting python source code?
Asked
Active
Viewed 1.6k times
5 Answers
38
Conventions: PEP 257 and PEP 8. Note, that docstrings can be written in reStructuredText
Tools for generating documentation: for example Sphinx

vartec
- 131,205
- 36
- 218
- 244
-
This should be the accepted answer – shrewmouse Jan 10 '19 at 15:24
-
Or, if you find yourself averse to reStructuredText, [pdoc](https://pdoc3.github.io/pdoc) also supports markdown and numpydoc docstring formats. – K3---rnc Jan 10 '19 at 16:48
16
First, put comments in your docstrings using RestructuredText format.
Second, get sphinx.
Third, create an index that uses the autodoc extension.
Then, run Sphinx to get really nice documentation.

S.Lott
- 384,516
- 81
- 508
- 779
10
Epydoc is also a good tool for documenting source code, and handles cross-referencing classes, modules, variables, etc, into HTML, PDF, LaTeX. Draws some nice class inheritance diagrams too. It's used by a number of open-source projects, so it's fairly actively developed.

Jarret Hardie
- 95,172
- 10
- 132
- 126