polymerist.genutils.textual.interpolation

For inserting text into other text in a rules-based manner

Functions

insert_into_text_periodic(→ str)

Takes a string of text and another "insertion" string and inserts it throughout the text every <period> characters

insert_into_text_periodic_re(→ str)

Takes a string of text and another "insertion" string and inserts it throughout the text every <period> characters

Module Contents

polymerist.genutils.textual.interpolation.insert_into_text_periodic(text: str, period: int, insertion: str = '\n') str[source]

Takes a string of text and another “insertion” string and inserts it throughout the text every <period> characters

polymerist.genutils.textual.interpolation.insert_into_text_periodic_re(text: str, period: int, insertion: str = '\n') str[source]

Takes a string of text and another “insertion” string and inserts it throughout the text every <period> characters Same as insert_into_text_periodic(), but implemented with regular expressions (allows for more complicated logical extensions)