code documentation for python

15,305

Solution 1

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.

Solution 2

Conventions: PEP 257 and PEP 8. Note, that docstrings can be written in reStructuredText

Tools for generating documentation: for example Sphinx

Solution 3

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.

Solution 4

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

Solution 5

using doxypy filter with doxygen is a good thing also

Share:
15,305
Alex. S.
Author by

Alex. S.

Developer and IT and stuff.

Updated on June 06, 2022

Comments

  • Alex. S.
    Alex. S. about 2 years

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

  • shrewmouse
    shrewmouse over 5 years
    This should be the accepted answer
  • K3---rnc
    K3---rnc over 5 years
    Or, if you find yourself averse to reStructuredText, pdoc also supports markdown and numpydoc docstring formats.