Skip to main content

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

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

anstrip-0.2.2.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distribution

anstrip-0.2.2-py3-none-any.whl (5.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page