Skip to content


Class PythonLoader

class PythonLoader(Loader)


This implementation of the Loader interface parses Python modules and packages using docspec_python. See the options below to control which modules and packages are being loaded and how to configure the parser.

With no modules or packages set, the PythonLoader will discover available modules in the current and src/ directory.

lib2to3 Quirks

Pydoc-Markdown doesn't execute your Python code but instead relies on the lib2to3 parser. This means it also inherits any quirks of lib2to3.

List of known quirks

  • A function argument in Python 3 cannot be called print even though it is legal syntax


A list of package names that this loader will search for and then parse, including all sub-packages and modules.


The module search path. If not specified, the current sys.path is used instead. If any of the elements contain a * (star) symbol, it will be expanded with sys.path.


List of modules to ignore when using module discovery on the search_path.


Options for the Python parser.


The encoding to use when reading the Python source files.

Changed in 4.7.0: Default changed from None (system default encoding) to "utf-8".