What is out there on conventions and tools for documenting python source code?
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.
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(...)
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.
Conventions: PEP 257 and PEP 8. Note, that docstrings can be written in reStructuredText
Tools for generating documentation: for example Sphinx
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With