package documentation

Text wrapping, filling, formatting, indenting etc.

From __init__.py:

Class BracketState Class for holding the depth of nested brackets when parsing text.
Function combine_lines_with_same_indent Undocumented
Function indent Indent all lines in x by n copys of string s
Function split_around_brackets Split on a separator sep, do not split on any separator inside any types of bracket.
Function to_tuple Converts a text representation of a tuple to a tuple of the specified type.
Function wrap Undocumented
Variable initial_whitespace Undocumented
Variable newline Undocumented
Variable space Undocumented
Variable str_break_chars Undocumented
Variable tab Undocumented
Variable _lgr Undocumented
def combine_lines_with_same_indent(x: str, preserve_repeated_empty_lines=False):

Undocumented

def indent(x: str, n: int, s: str = tab):

Indent all lines in x by n copys of string s

def split_around_brackets(x: str, sep: str = ','):

Split on a separator sep, do not split on any separator inside any types of bracket.

def to_tuple(x: str, t: type[type] | Iterable[type]):

Converts a text representation of a tuple to a tuple of the specified type.

Parameters
x:strstr string to convert to a tuple
t:type[type] | Iterable[type]type[type] | Iterable[type] Type of tuple to convert to. If t is not an iterable, then will convert to a homogeneous tuple, otherwise will convert each element of x to the corresponding element of t
def wrap(x: str, width=70, combine_strings_of_same_indent_level=True):

Undocumented

initial_whitespace =

Undocumented

newline: str =

Undocumented

space: str =

Undocumented

str_break_chars =

Undocumented

tab: str =

Undocumented

_lgr =

Undocumented