Autodocumenting Python using Sphinx Autodocumenting Python using Sphinx python python

Autodocumenting Python using Sphinx


To make things easier you can use this script (look at the bottom of the page for the last version):http://bitbucket.org/birkenfeld/sphinx/issue/98/add-the-autogenerate-script-to-sphinx

This script will parse your packages/modules and generate all the rest files necessary to build the doc from docstrings.

I'm the original author of this script.

UPDATE

This script is now part of Sphinx 1.1 as apidoc.


Etienne's script, mentioned in his answer, has now been integrated into Sphinx as sphinx-apidoc. It does exactly what the OP wants. It is slated for release in Sphinx 1.1, or is available from the Hg repo:

https://bitbucket.org/birkenfeld/sphinx

It works beautifully for me. The docs read thus:

> sphinx-apidoc --helpUsage: sphinx-apidoc-script.py [options] -o <output_path> <module_path>           [exclude_paths, ...]Look recursively in <module_path> for Python modules and packages and createa reST file with automodule directives per package in the <output_path>.