1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] How to generate documentation for multiple files using pydoc

Discussão em 'Python' iniciado por Stack, Setembro 8, 2025.

  1. Stack

    Stack Membro Participativo

    I tried to generate documentation for my python project using pydoc.

    My repository looks like this:

    main.py
    src/
    ├─ cli.py
    ├─ ui.py


    In the main.py file, I have these imports:

    import argparse
    import sys
    from PyQt5 import QtWidgets

    from src.cli import CommandLineTool
    from src.ui import UserInterfaceTool


    When I tried to generate the documentation using python -m pydoc -w main, it worked but there is no reference to the src.cli and src.ui modules. Here is the modules part in HTML:

    <tr><td class="decor pkg-content-decor"><span class="code">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></td><td>&nbsp;</td>
    <td class="singlecolumn"><table><tr><td class="multicolumn"><a href="PyQt5.QtWidgets.html">PyQt5.QtWidgets</a><br>
    </td><td class="multicolumn"><a href="argparse.html">argparse</a><br>
    </td><td class="multicolumn"><a href="sys.html">sys</a><br>
    </td><td class="multicolumn"></td></tr></table></td></tr></table>
    </body></html>


    I generated the docs for src.ui and src.cli using python -m pydoc -w src.ui and python -m pydoc -w src.cli but the result is still the same. Do you know if it's something that is doable with pydoc, or if I maybe missed a parameter or an option somewhere ?

    Continue reading...

Compartilhe esta Página