Skip to main content

Create documentation from python modules and other objects.

Project description

Create documentation from python modules and other objects.

Latest release 20220311: module_doc: class members no longer rendered as headings, too verbose.

Function is_dunder(name)

Test whether a name is a dunder name (__foo__).

Function module_doc(module, *, sort_key=<function <lambda> at 0x10bca9040>, filter_key=<function <lambda> at 0x10bca90d0>, 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

Function 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.

Release Log

Release 20220311: module_doc: class members no longer rendered as headings, too verbose.

Release 20210306: Drop noise leaked into output.

Release 20210123:

  • module_doc: include properties/descriptors.
  • DISTINFO: this is not Python 2 compatible, drop tag.

Release 20200718:

  • New is_dunder(name) function to test whether name is a dunder name.
  • module_doc: new method_names parameter to report only specific attributes from a class - default is all public names and most dunder methods - things without docs are not reported.
  • Assorted small changes.

Release 20200521: Initial PyPI release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cs.py.doc-20220311.tar.gz (4.1 kB view details)

Uploaded Source

File details

Details for the file cs.py.doc-20220311.tar.gz.

File metadata

  • Download URL: cs.py.doc-20220311.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.10

File hashes

Hashes for cs.py.doc-20220311.tar.gz
Algorithm Hash digest
SHA256 e687f28d55802ea12f01bd7a9c527c379f0a7fefcae3747d95ee8f190ab1f1e8
MD5 f5d88c5761079934900391109dcfdddd
BLAKE2b-256 c8b11fbca4e104ea171c32771d0462e71349ad508871c3c0f2010b43d2c2e9fc

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page