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
1 answer

Sphinx-build generates error for SWIG generated python file while importing the python module

I am trying to generate documentation of some python interface module generated by SWIG on C code. I am using %feature(docstring) directive in SWIG interface files (*.i) as mentioned the post: Sphinx and documenting python from a swigged C++…
0
votes
0 answers

sphinx autodoc dynamic inheritance

I am new to using Sphinx and stumbled upon a problem while using the autodoc function (sphinx-apidoc). One of my modules defines a function that uses dynamic inheritance, like this: def generate_object(base_class, *args, **kwargs): """This…
Bart
  • 11
  • 1
0
votes
1 answer

Sphinx directory structure for rst and html generated

I have been working on setting up auto documentation for my Python files, which are in a large hierarchy of directory structure. I am able to generate rst and html files for all of them with my scripts and by using autodoc module. I was wondering if…
Akshay Shah
  • 323
  • 2
  • 16
0
votes
0 answers

Sphinx cannot find module for autodoc even after including it in sys.path

I have a large directory structure so instead of manually adding the paths, i am searching for all modules using os.walk(). Whenever I am finding a directory containing a __init__.py file I am including that directory in the PYTHONPATH by using the…
0
votes
1 answer

Sphinx autodoc with parameter from a mocked module on readthedocs

We are using readthedocs to document our open source project pandapower. Since pandapower has dependencies to numpy and other C libraries that can't be built on rtd, we use the autodoc_mock_imports parameter to create mock imports for these…
lthurner
  • 75
  • 1
  • 7
0
votes
2 answers

Readthedocs: Is there a way to autodoc same model functions separately in the one file?

Right now my docs/source has an index.rst that in its doctree imports another file called api.rst. In this api.rst file I would like to autodoc a python module. This module is a .py with many functions not attached to any class, but they are…
Joabe da Luz
  • 1,030
  • 2
  • 18
  • 32
0
votes
1 answer

List dictionaries in documentation with Sphinx

I have a project with a few .py files that only contains a few dictionaries. Like this: # My file dictionary = {'key1': 'value1', 'key2: 'value2'} But much larger and longer and I would like to document this with Sphinx but I can't get it to work…
Hejhej
  • 1
  • 2
0
votes
0 answers

autodoc of python decorator wrapped functions in a file

I searched and searched for a solution where I can use Sphinx autodoc to find all the decorator wrapped functions in my Python script/file. The script contains a number of functions all called step_impl with different parameters, but each wrapped by…
simi
  • 1,535
  • 3
  • 12
  • 14
0
votes
1 answer

Sphinx decorated classes not documented

I'm documenting my library with Sphinx. And I have decorator logic_object: class logic_object: """Decorator for logic object class. """ def __init__(self, cls): self.cls = cls self.__doc__ = self.cls.__doc__ And I have…
knowledge
  • 383
  • 3
  • 15
0
votes
1 answer

Autodoc an __init__(self) method: getting "autodoc-skip-member" to work

There is a previous question on getting Sphinx to document certain special methods only (the __init__(self) in that case): How to use Sphinx's autodoc to document a class's __init__(self) method? The accepted answer lists 3 options, the first of…
user2690051
  • 155
  • 1
  • 1
  • 9
0
votes
1 answer

Getting Sphinx autodoc to include 'hidden' classes

We have a module, in which each class file is in a file starting with an underscore. In the init.py, we import these files, and we expose constructor functions for each class (this is necessary as each class constructor needs some additional state…
Graham Wheeler
  • 2,734
  • 1
  • 19
  • 23
0
votes
1 answer

robot framework sphinx integration

I am trying to figure out a way to do basically what sphinx autodoc does but with robot framework tests and user-defined keywords. I've looked at sphinxcontrib-robotdoc and sphinxcontrib-robotframework and neither do quite what I'm looking for (to…
Rohit
  • 1
  • 2
0
votes
1 answer

Sphinx autodoc TypeError: 'type' object is not iterable

When trying to build documentation (any type: html, man pages, latexpdf...) sphinx fails while trying to autodoc a subdirectory of a project. I've tried many different approaches to try to narrow down what the problem is but I can't seem to find the…
0
votes
1 answer

Sphinx: autodoc fails for certain modules due to hardware-specific libraries raising exceptions on the dev machine

I'm working in a project involving the Raspberry Pi and the PiFace interface module. The project is being developed in Python and I have run into a problem when trying to auto document some modules with Sphinx. We are using the pifacedigitalio…
ctroncoso
  • 1
  • 2
0
votes
1 answer

Leiningen Crash with Autodoc (sh does not exist)

I am trying to use Clojure autodoc in my project. My project.clj looks like this: :license {:name "Eclipse Public License" :url "http://www.eclipse.org/legal/epl-v10.html"} :dependencies [[org.clojure/clojure "1.6.0"]] :plugins…
David Williams
  • 8,388
  • 23
  • 83
  • 171
1 2 3
30
31