21

What is out there on conventions and tools for documenting python source code?

Alex. S.
  • 143,260
  • 19
  • 55
  • 62

5 Answers5

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
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
6

It's very nice to put code documentation in the code itself. See:

dwc
  • 24,196
  • 7
  • 44
  • 55
1

using doxypy filter with doxygen is a good thing also

sancelot
  • 1,905
  • 12
  • 31