Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

code documentation for python [closed]

Tags:

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

like image 952
Alex. S. Avatar asked Mar 11 '09 16:03

Alex. S.


People also ask

What is the best documentation for Python?

Sphinx. Sphinx is far and away the most popular Python documentation tool. Use it. It converts reStructuredText markup language into a range of output formats including HTML, LaTeX (for printable PDF versions), manual pages, and plain text.

How do I see Python documentation?

Python has a built-in help() function that can access this information and prints the results. For example, to see the documentation of the built-in len function, you can do the following: In [1]: help(len) Help on built-in function len in module builtins: len(...)

Does Python have documentation?

The Python language has a substantial body of documentation, much of it contributed by various authors. The markup used for the Python documentation is reStructuredText, developed by the docutils project, amended by custom directives and using a toolset named Sphinx to post-process the HTML output.


2 Answers

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

Tools for generating documentation: for example Sphinx

like image 76
vartec Avatar answered Sep 23 '22 03:09

vartec


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.

like image 20
S.Lott Avatar answered Sep 24 '22 03:09

S.Lott