Questions tagged [autodoc]

Extension for the Sphinx documentation generator that imports Python modules in order to extract docstrings in a semi-automatic way.

Python Sphinx extension that can import the modules being documented, and pull in documentation from docstrings in a semi-automatic way.

The sphix.ext.autodoc extension can be used in conjunction with the sphinx.ext.napoleon extension. This allows use of NumPy and Google style docstrings. The Napoleon prepocessor will initially convert your docstrings to ReStructured text, that afterwards is processed by autodoc.

Several commonly used directives are provided by autodoc, namely ..automodule:: and ..autoclass: For examples of use see the sphinx.ext.autodoc documentation.

See also:

456 questions
0
votes
0 answers

Telling sphinx not to include base class

I have a module named wrapper_iperf which basically wraps some calls to iperf3. The module contains a class named "ThreadWithReturnValue(Thread)" which is obviously derived from Thread. This class contains the overriden methods run and join. class…
Tom L.
  • 932
  • 2
  • 9
  • 30
0
votes
0 answers

How to create autodoc with sphinx on a pytest marked class?

Having such class marked with pytest.mark.parametrize: @pytest.mark.parametrize('app_lang', MobileAppLanguageMark.all(), scope='session') class MobileBaseCase(BaseCase): def foo(self, a, b): """ assadasdasda """ …
Ciszko
  • 175
  • 1
  • 13
0
votes
1 answer

Missing classes while generating documentation with Sphinx make latexpdf

I am using Sphinx to generate the documentation in python. While make html is working just fine, I have problems with make latexpdf. The .tex file is generated incompletely. It is missing some descriptions, which are included in html. I don't see…
prody
  • 194
  • 1
  • 11
0
votes
0 answers

How to use sphinx with nested directories when not all directories contain python files

This question seems to be fairly common, for example, here or here, but their solutions did not work for me. The directory structure looks like this: └──faulty_meters_study └── __init__.py └── utils.py └── anomaly_detection.py └──…
Schach21
  • 412
  • 4
  • 21
0
votes
1 answer

How to show private-members separately?

Currently, I am describing module as: .. autoclass:: package.module.class :members: :undoc-members: :show-inheritance: :private-members: :member-order: bysource And it shows all members in a row. I want to do something as: ..…
banderlog013
  • 2,207
  • 24
  • 33
0
votes
1 answer

Sphinx PDF output does not include auto-generated documentation from code

I use the following conf.py for a python project. The html generated files is nice and provide the auto generated documents from the codes, but the pdf file is almost empty and only includes conents in the rst files. import os import sys import…
Abolfazl
  • 1,047
  • 2
  • 12
  • 29
0
votes
1 answer

Sphinx documentation - How can I hide function parameters inherited from the parent class' function?

I have the following classes import abc class Parent(metaclass=abc.ABCMeta): def __init__( self, username: str, password: str, log_file: Optional[str] = None, secret: Optional[str] = None, …
CaffeinatedMike
  • 1,537
  • 2
  • 25
  • 57
0
votes
0 answers

How to use Sphinx autofunction for file outside module

I have a package written, call it MAUDIE. Also in the folder containing the MAUDIE modules, I have a docs folder containing the sphinx documentation, and a tutorial folder. In the tutorial folder, I have a file use_Maudie.py, it's a script to run a…
user2954167
  • 155
  • 1
  • 3
  • 14
0
votes
0 answers

Sphinx : How to create an own sample of documentation in Sphinx and to use it for next projects without Sphinx QuickStart

I am a beginner with a Sphinx and generally with Informatics. I need to create a sample of a documentation for all my future documentations (they have the same structure) because right now I run for every new documentation QuickStart, copy old rst…
0
votes
2 answers

Why does autoclass create aliases here?

In short, I have code that works but if I make a slight tweak, some things fall apart and I can't seem to figure out why. I'm hoping someone more experienced than me can give me a few Sphinx pointers. I've searched and haven't seen anything like…
coney1
  • 1
  • 1
0
votes
0 answers

don't know which module to import (try placing a "module" or "currentmodule" directive in the document, or giving an explicit module name)

I'm new to Sphinx and I'm using Sphinx's auto-generate tool. I was trying to import all methods in a class from a python folder. I successfully set the path in conf.py like this import os import sys sys.path.insert(0,…
heat9
  • 21
  • 3
0
votes
0 answers

generating a sphinx documentation with documentations for multiple versions from local directories

I currently have a software that I documented using sphinx. I created a website and display the actual documentation part using sphin autodoc. For now, I have the package installed on my local python version so I can simply say .. autoclass::…
Yes
  • 339
  • 3
  • 19
0
votes
0 answers

How to handle class import aliases in sphinx autodoc

I have a project with the following directory structure: project datasets __init__.py foo.py bar.py bar.py defines a class Bar which inherits from the Foo class defined in foo.py. In __init__.py, I have the following…
Adam Stewart
  • 2,001
  • 1
  • 16
  • 16
0
votes
1 answer

Skip Empty Modules - Sphinx Autodoc

I am using Sphinx to build documentation for a package. I can't find a way to skip (remove) empty submodules when building doc. Example in Section 2 there is a subsection named Submodule which is blank I want to skip such subsections. I tried using…
Lopez
  • 461
  • 5
  • 19
0
votes
1 answer

Sphinx autoclass works locally, not readthedocs, but other classes and methods work on readthedocs?

I know there's several similar questions, but none of them seem to fit what is happening with me. When I build on readthedocs, it is successful. However, it doesn't show in the documentation, but will show locally. What my issue is, is that it…
Brandon Molyneaux
  • 1,543
  • 2
  • 12
  • 23