cape.text: Text modification utils for CAPE¶
This module provides several functions for modifying Python docstrings.
One of these, provided by the function markdown(), which removes
much of the reST syntax used to make this documentation and prints a
more readable message for command-line help messages.
There is another function setdocvals() which can be used to
rapidly substitute strings such as _atol_ with a value for atol
taken from a dict.
- cape.textutils.get_nstart(line, c)¶
Count number of instances of character c at start of a line
- cape.textutils.markdown(doc)¶
Remove some extraneous markup for command-line help messages
- cape.textutils.markdown_try(doc)¶
Remove some extraneous markup for command-line help messages
- cape.textutils.pprint_n(x: float | int, nchar: int = 3) str¶
Format a string as number thousands, millions, etc.
- cape.textutils.setdocvals(doc, vals)¶
Replace tags such as
"_tol_"with values from a dictionary