Skip to main content

Create documentation from python modules and other objects.

Project description

Create documentation from python modules and other objects.

Latest release 20241007:

  • module_doc: for subclasses of cs.fsm.FSM embed an SVG state transition diagram.
  • module_doc: put HTML named anchors on the headings.
  • module_doc: use BaseCommand.extract_usage() with BaseCOmmand subclasses.

is_dunder(name)

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

module_doc(module, *, sort_key=<function <lambda> at 0x10f78be20>, filter_key=<function <lambda> at 0x10f7c9d00>, 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.

Release Log

Release 20241007:

  • module_doc: for subclasses of cs.fsm.FSM embed an SVG state transition diagram.
  • module_doc: put HTML named anchors on the headings.
  • module_doc: use BaseCommand.extract_usage() with BaseCOmmand subclasses.

Release 20240709: module_doc: do not insert a BaseCommand usage into the docs, the BaseCommand.init_subclass will be doing that for us.

Release 20240630.1: module_doc: build the usage message from an instance of the baseCommand, needed since the last cs.cmdutils release.

Release 20240630: module_doc: insert the class usage message for subclasses of BaseCommand.

Release 20240422: module_doc: only list things in all if provided.

Release 20240412: module_doc: classes: MRO: suppress classes which are not immediate superclasses.

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-20241007.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cs.py.doc-20241007-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file cs_py_doc-20241007.tar.gz.

File metadata

  • Download URL: cs_py_doc-20241007.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for cs_py_doc-20241007.tar.gz
Algorithm Hash digest
SHA256 e43c1ae7c6f1ecceb430a09296a1d1f5819e5793516c3d1a3153b4d77c2e3e66
MD5 0334a498edc63364a8056834126acc50
BLAKE2b-256 f1f1c0d0dbd3c31242504b93145a4586dabfdd73ca902fb382ca2572d8ab0d5e

See more details on using hashes here.

File details

Details for the file cs.py.doc-20241007-py3-none-any.whl.

File metadata

  • Download URL: cs.py.doc-20241007-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.0

File hashes

Hashes for cs.py.doc-20241007-py3-none-any.whl
Algorithm Hash digest
SHA256 26555bbb5b85ca237cb71042cf48c48f04a15975802762e97f26be95e94c3227
MD5 b30615ba8dfd585fa01625b3ace08291
BLAKE2b-256 10fe11b772d54ab6f3ec3e9d3994eac9b03b82c1a80551435eeea5a8e88e66cb

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