textwrap, but savvy to ANSI colors and styles
Project description
ansiwrap wraps text, like the standard textwrap module. But it also correctly wraps text that contains ANSI control sequences that colorize or style text.
Where textwrap is fooled by the raw string length of those control codes, ansiwrap is not; it understands that however much those codes affect color and display style, but have no logical length.
The API mirrors the wrap and fill functions of textwrap.
See also the enclosed demo.py.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ansiwrap-0.5.1.zip
(13.1 kB
view hashes)
Built Distribution
Close
Hashes for ansiwrap-0.5.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdcd91dd891f6bbbc503d7fbadad0f9ed20f95f5e65723d9fd43aba382f770b8 |
|
MD5 | 6b8cca8a4fcfc0b724568c307bd36dc6 |
|
BLAKE2b-256 | d19070707461417bfc259a164c9dc5333051bc7e040286a830dba379ff3be20c |