Metadata-Version: 2.4
Name: cs-py-doc
Version: 20261016
Summary: Create documentation from python modules and other objects.
Keywords: python2,python3
Author-email: Cameron Simpson <cs@cskk.id.au>
Description-Content-Type: text/markdown
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Requires-Dist: cs.fsm>=20261016
Requires-Dist: cs.gvutils>=20260914
Requires-Dist: cs.lex>=20261016
Requires-Dist: cs.logutils>=20260912
Requires-Dist: cs.pfx>=20260912
Requires-Dist: cs.py.modules>=20260531
Project-URL: MonoRepo Commits, https://bitbucket.org/cameron_simpson/css/commits/branch/main
Project-URL: Monorepo Git Mirror, https://github.com/cameron-simpson/css
Project-URL: Monorepo Hg/Mercurial Mirror, https://hg.sr.ht/~cameron-simpson/css
Project-URL: Source, https://github.com/cameron-simpson/css/blob/main/lib/python/cs/py/doc.py

Create documentation from python modules and other objects.



Short summary:


* `is_dunder`: Test whether a name is a dunder name (`__`*foo*`__`).


* `module_doc`: Fetch the docstrings from a module and assemble a MarkDown document.


* `obj_docstring`: Return a docstring for `obj` which has been passed through `stripped_dedent`.

# Functions

## is_dunder(name)

Test whether a name is a dunder name (`__`*foo*`__`).

## module_doc(module, *, sort_key=<function <lambda> at 0x1066845e0>, filter_key=<function <lambda> at 0x106684d60>, method_names=None)

Fetch the docstrings from a module and assemble a MarkDown document.

Parameters:
* `module`: the module or module name to inspect
* `sort_key`: optional key for sorting names in the documentation;
  default: `name`
* filter_key`: optional test for a key used to select or reject keys
  to appear in the documentation
* `method_names`: optional list of method names to document;
  the default is to document `__init__`, then CONSTANTS, the
  dunders, then other public names

## obj_docstring(obj)

Return a docstring for `obj` which has been passed through `stripped_dedent`.

This function uses `obj.__doc__` if it is not `None`,
otherwise `getcomments(obj)` if that is not `None`,
otherwise `''`.
The chosen string is passed through `stripped_dedent` before return.
