Best way to document Python code...
adonis at REMOVETHISearthlink.net
Mon Jan 22 21:40:57 CET 2007
Scott Huey wrote:
> I am working on a Python module and I would like to prepare some API
> documentaiton. I managed to find epydoc after some searching online.
> Is there a standard way to document the API for Python modules? Is
> epydoc the best way to go if there is no standard? Are there other ways
> to document a Python API?
> Scott Huey
The "standard" is to use docstrings
This module does something
This method does something, accepts args/returns value etc.
Then one way to view the docstrings is to start a python shell, import
your module, and do help(MyModule)
do in the shell:
Then Python will generate a quick help interface for your module. I
suspect epydoc uses docstrings but I *may* be wrong, since I have never
used epydoc. But a quick look at pydoc (not to be confused with epydoc)
which is part of the standard library allows you to generate
documentation in HTML format, and/or serve it over web with its built-in
Hope this helps.
More information about the Python-list