skip to navigation
skip to content

getdoc 0.3.0

Simple function to get a python module's doc recursively

python-getdoc

Simple function to get a python module’s doc recursively

License

Software licensed under MPL 2.0 license.

Installation

(Not yet on PyPi, clone the repo)

pip install getdoc

Development

To run all the tests: tox

Usage

import some_module
from getdoc import get_module_doc

doc = get_module_doc(some_module)
# The result is a nested list of tuple: (type, name, doc),
# type being 'function', 'class', or 'module'.

# You can exclude modules, classes or functions with exclude options.
# Their content are used as prefixes:
doc = get_module_doc(some_module,
                     exclude_module=('django', ),
                     exclude_class=('DoesNotExist', 'MultipleObjectsReturned'),
                     exclude_function=('_', ))

# You can get doc for just a class (and its contents), or just a function.
from getdoc import get_class_doc, get_function_doc

doc = get_class_doc(some_module.SomeClass,
                    exclude_class=None,
                    exclude_function=None)
doc = get_function_doc(some_module.SomeClass.some_function,
                       exclude_function=None)

Changelog

0.1.0 (2016-11-17)

  • Alpha release on PyPI.
 
File Type Py Version Uploaded on Size
getdoc-0.3.0-py2.py3-none-any.whl (md5) Python Wheel py2.py3 2016-11-18 5KB
getdoc-0.3.0.tar.gz (md5) Source 2016-11-18 14KB