Automatic Python documentation with Sphinx autodoc and ReadTheDocs
Generating Python documentation for packages/modules can be quite time consuming, but there's a way to generate it automatically from docstrings. This post is mostly a summary of the fantastic guide by Sam Nicholls found here, but with one important addition (see the section on mocking). We'll be using the following: Sphinx - Python package for generating documentationSphinx autodoc - Sphinx extension to generate documentation from docstringsReadTheDocs - build and host documentation online Before you start, make sure you've written docstrings for your modules/functions/methods. This is the most time consuming part, but you should be commenting and documenting your code anyway!…