Python3: API Documentation generator

Ken Watford kwatford+python at gmail.com
Mon Sep 27 20:44:08 CEST 2010


On Mon, Sep 27, 2010 at 1:15 PM, Tim Diels <limyreth at gmail.com> wrote:
> On 27/09/2010 09:02, Chris Rebert wrote:
>>
>> On Sun, Sep 26, 2010 at 11:56 PM, Tim Diels<farkmor at gmail.com>  wrote:
>>>
>>>  Hi all
>>>
>>> I've just switched to python3 and it turns out my current API
>>> documentation
>>> generator (epydoc) no longer works. I am looking for a tool that reads
>>> the
>>> docstrings of all classes, ... in my project and turns it into HTML
>>> documentation.
>>
>> Sphinx (http://sphinx.pocoo.org/ ) is the new gold standard. You'll
>> want to enable the `autodoc` extension:
>> http://sphinx.pocoo.org/ext/autodoc.html
>>
>> Cheers,
>> Chris
>> --
>> http://blog.rebertia.com
>
> I tried, but it fails to run through python code that's not backwards
> compatible with older python versions.
>
> It fails with: ...autodoc can't import/find module 'pytilities', it reported
> error: "invalid syntax (overload.py, line 55)"...
>
> This is line 55 (runs in python3, not in python):
> def process_args(self, *args, kwargs={})
>

As far as I'm aware, autodoc works by importing the modules and then
reading doctext straight from the __doc__ attributes.
So the module in question has to import correctly in whatever
interpreter Sphinx is using. You probably need to install Sphinx with
python3 to get it to use the right interpreter. If you're using
easy_install or pip, check if you have an easy_install-3.1 or pip-3.1
(or similar) script installed.



More information about the Python-list mailing list