Skip to content
/ anstrip Public

anstrip is a minimal library to strip ANSI sequences from strings.

License

Notifications You must be signed in to change notification settings

qexat/anstrip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

anstrip

PyPI

anstrip is a minimal library to strip ANSI sequences from strings.

It provides:

  • PATTERN, the regex pattern used by the functions of anstrip
  • strip, a function to remove all the escape sequences from a string
  • auto_strip, a function that is similar to strip, except that it only removes if the output is a TTY
  • print, a function that is similar to the built-in print but with sequence auto-stripping
  • printed_length, a function that returns the length of the string as seen on the screen