Metadata-Version: 2.1
Name: anstrip
Version: 0.2.1
Summary: anstrip is a minimal library to strip ANSI sequences from strings.
Author-email: Qexat <contact@qexat.com>
License: MIT License
        
        Copyright (c) 2024 Qexat
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
Project-URL: source, https://github.com/qexat/anstrip
Keywords: ansi,escape sequence,SGR,ECMA,strip
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest >=7.4 ; extra == 'dev'
Requires-Dist: coverage >=7.4 ; extra == 'dev'
Requires-Dist: pyright >=1.1 ; extra == 'dev'
Requires-Dist: build ; extra == 'dev'
Requires-Dist: twine ; extra == 'dev'

# anstrip

[![PyPI](https://img.shields.io/pypi/v/anstrip)](https://pypi.org/project/anstrip/)

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
