I am using decorators on classes in my python code. I need to generate some xml which contains which classes have which decorators, which module they are in, and what are the globals in those modules. I have tried all major documentation generators, but could not figure out even which is capable to do this.
- Doxygen (1.8.13-10): the generated documentation have no reference to any decorators
- Sphinx: I could not even get sphinx to generate any documentation on my modules. I have tried a couple of howtos, but automodule just does not seem to work.
- pydoctor: I was using this in python2 projects with a custom generator class, but does not work with python3
- pdoc works, but no decorators, and I do not see any way to generate xml
- pydoc3 just says there is no documentation found (as there are no comments, it is clean code)
A minimal example would contain the following tree:
src/categorizerai
src/categorizerai/__init__.py
src/categorizerai/ExampleService.py
Where __init__.py
is empty, and ExampleService.py
have the following code:
from winterboot.Autowired import Autowired
underlyingService = Autowired('underlyingService')
@Service
ExampleService(object):
def serviceCall(foo: int = 0) -> int:
return foo+1;
At the end I would create an xml like this (anything containing the necessary information is okay, I can xslt):
<project>
<package name="categorizerai">
<class type="Service" name="ExampleService"><!-- the type comes from the decorator -->
<dependency name="underlyingService"/><!-- name of the global in the same module-->
<method name="serviceCall" returns="int">
<parameter name="foo" type="int" default="0"/>
</method>
</class>
</package>
</project>