Skip to content

[πŸš€ Feature]: Auto-generate the Python API from the codeΒ #14178

@emanlove

Description

@emanlove

Feature and motivation

Some recent improvements have been made to the generation of the Python API documentation. Now the Python API doc is generated from the py/docs/source/api.st "template". Taking this a step further we should be able to generate the API from just the code itself. This is important as any updates to the code, for example recent additions with selenium.webdriver.common.bidi, needs to be manually added to this api.rst file, as shown here

Webdriver.common
----------------

.. currentmodule:: selenium.webdriver.common
.. autosummary::
   :toctree: webdriver

   selenium.webdriver.common.action_chains
   ...
   selenium.webdriver.common.bidi.cdp
   selenium.webdriver.common.bidi.console
   selenium.webdriver.common.bidi.script
   selenium.webdriver.common.bidi.session

And if we forgot to add, say selenium.webdriver.common.bidi.script, then it would be missing from the doc. So it would be good to either fully auto-generate it or have some automatic method to check for completeness and changes.

Usage example

Might add a step to the tox.ini to autogenerate the api doc from the code or check for completeness.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-pyPython BindingsI-enhancementSomething could be betterR-help wantedIssues looking for contributions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions