module documentation

Creates reST files corresponding to Python modules for code documentation. Parses a directory tree looking for Python modules and packages and creates ReST files appropriately to create code documentation with Sphinx. It also creates a modules index (named modules.<suffix>). This is derived from the "sphinx-autopackage" script, which is: Copyright 2008 Société des arts technologiques (SAT), https://sat.qc.ca/

Function create_module_file Build the text of the file and write the file.
Function create_modules_toc_file Create the module's index.
Function create_package_file Build the text of the file and write the file.
Function get_parser Undocumented
Function has_child_module Check the given directory contains child module/s (at least one).
Function is_excluded Check if the directory is in the exclude list.
Function is_initpy Check *filename* is __init__ file or not.
Function is_packagedir Check given *files* contains __init__ file.
Function is_skipped_module Check if we want to skip this module.
Function is_skipped_package Check if we want to skip this module.
Function main Parse and check the command line arguments.
Function module_join Join module names with dots.
Function recurse_tree Look for every file in the directory tree and create the corresponding ReST files.
Function walk Walk through the directory and list files and subdirectories up.
Function write_file Write the output file for module/package <name>.
Constant OPTIONS Undocumented
Constant PY_SUFFIXES Undocumented
Variable template_dir Undocumented
def create_module_file(package, basename, opts, user_template_dir=None): (source)

Build the text of the file and write the file.

Parameters
package:strUndocumented
basename:strUndocumented
opts:AnyUndocumented
user_template_dir:str|NoneUndocumented
def create_modules_toc_file(modules, opts, name='modules', user_template_dir=None): (source)

Create the module's index.

Parameters
modules:list[str]Undocumented
opts:AnyUndocumented
name:strUndocumented
user_template_dir:str|NoneUndocumented
def create_package_file(root, master_package, subroot, py_files, opts, subs, is_namespace, excludes=[], user_template_dir=None): (source)

Build the text of the file and write the file.

Parameters
root:strUndocumented
master_package:strUndocumented
subroot:strUndocumented
py_files:list[str]Undocumented
opts:AnyUndocumented
subs:list[str]Undocumented
is_namespace:boolUndocumented
excludes:list[str]Undocumented
user_template_dir:str|NoneUndocumented
def get_parser(): (source)

Undocumented

Returns
argparse.ArgumentParserUndocumented
def has_child_module(rootpath, excludes, opts): (source)

Check the given directory contains child module/s (at least one).

Parameters
rootpath:strUndocumented
excludes:list[str]Undocumented
opts:AnyUndocumented
Returns
boolUndocumented
def is_excluded(root, excludes): (source)

Check if the directory is in the exclude list. Note: by having trailing slashes, we avoid common prefix issues, like e.g. an exclude "foo" also accidentally excluding "foobar".

Parameters
root:strUndocumented
excludes:list[str]Undocumented
Returns
boolUndocumented
def is_initpy(filename): (source)

Check *filename* is __init__ file or not.

Parameters
filename:strUndocumented
Returns
boolUndocumented
def is_packagedir(dirname=None, files=None): (source)

Check given *files* contains __init__ file.

Parameters
dirname:str|NoneUndocumented
files:list[str]|NoneUndocumented
Returns
boolUndocumented
def is_skipped_module(filename, opts, excludes): (source)

Check if we want to skip this module.

Parameters
filename:strUndocumented
opts:AnyUndocumented
excludes:list[str]Undocumented
Returns
boolUndocumented
def is_skipped_package(dirname, opts, excludes=[]): (source)

Check if we want to skip this module.

Parameters
dirname:strUndocumented
opts:AnyUndocumented
excludes:list[str]Undocumented
Returns
boolUndocumented
def main(argv=sys.argv[1:]): (source)

Parse and check the command line arguments.

Parameters
argv:list[str]Undocumented
Returns
intUndocumented
def module_join(*modnames): (source)

Join module names with dots.

Parameters
*modnames:strUndocumented
Returns
strUndocumented
def recurse_tree(rootpath, excludes, opts, user_template_dir=None): (source)

Look for every file in the directory tree and create the corresponding ReST files.

Parameters
rootpath:strUndocumented
excludes:list[str]Undocumented
opts:AnyUndocumented
user_template_dir:str|NoneUndocumented
Returns
list[str]Undocumented
def walk(rootpath, excludes, opts): (source)

Walk through the directory and list files and subdirectories up.

Parameters
rootpath:strUndocumented
excludes:list[str]Undocumented
opts:AnyUndocumented
Returns
Generator[tuple[str, list[str], list[str]], None, None]Undocumented
def write_file(name, text, opts): (source)

Write the output file for module/package <name>.

Parameters
name:strUndocumented
text:strUndocumented
opts:AnyUndocumented

Undocumented

Value
os.environ['SPHINX_APIDOC_OPTIONS'].split(',')
PY_SUFFIXES = (source)

Undocumented

Value
('.py', '.pyx')+tuple(EXTENSION_SUFFIXES)
template_dir = (source)

Undocumented