Python sphinx 如何为列出所有属性和方法的类生成存根?

Python sphinx 如何为列出所有属性和方法的类生成存根?,python-sphinx,Python Sphinx,我想要的是为我拥有的每个类生成存根,包括所有属性和方法的列表: project.class ============= .. currentmodule:: project .. autoclass:: class .. rubric:: Methods .. autosummary:: project.method1 project.method2 .. rubric:: Attributes .. autosummary::

我想要的是为我拥有的每个类生成存根,包括所有属性和方法的列表:

project.class
=============

.. currentmodule:: project

.. autoclass:: class

   .. rubric:: Methods

   .. autosummary::

      project.method1
      project.method2

   .. rubric:: Attributes

   .. autosummary::

      project.attribute1
      project.attribute2

我怎样才能做到这一点?似乎
sphinx apidoc
sphinx autogen
无法实现这一点。

每个类都有一个存根。当然,它不是全自动的。您必须枚举autosummary指令中的类。但是编写一个这样做的脚本应该不是不可能的。每个类都有一个存根。当然,它不是全自动的。您必须枚举autosummary指令中的类。但是写一个这样的脚本应该不是不可能的。