Registry / serialization / strip-ansi

strip-ansi

JSON →
library0.1.1pypypi✓ verified 85d ago

A minimal library to strip ANSI escape sequences from strings. Designed to remove terminal color codes and control sequences. Version 0.1.1, stable, no recent updates. Requires Python >=3.6.

pip install strip-ansi
INSTALL
IMPORT
SIG · STRIP-ANSI
S
strip-ansi
serializationpythonv0.1.1
Install
1.5s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

strip_ansi
from strip_ansi import strip_ansi

Import and use the function to strip ANSI codes.

from strip_ansi import strip_ansi text = "\x1b[31mHello\x1b[0m World" clean = strip_ansi(text) print(clean) # Output: Hello World
Debug
Known issues
gotchaThe library does not handle all edge cases of ANSI sequences (e.g., non-standard or malformed sequences).
fix
If you need comprehensive handling, consider using 're' or other libraries like 'colorama'.
affects: <=0.1.1
gotchaThe function is named the same as the package, which can cause naming conflicts if you import the package directly.
fix
Always use 'from strip_ansi import strip_ansi' or alias the import.
affects: all
Errors
Common errors & fixes
AttributeError: module 'strip_ansi' has no attribute 'strip_ansi'
Using 'import strip_ansi' instead of 'from strip_ansi import strip_ansi'.
fix
Change to 'from strip_ansi import strip_ansi'.
ImportError: cannot import name 'strip_ansi' from 'strip_ansi'
Pip installed the package incorrectly or a different package named 'strip_ansi' exists.
fix
Uninstall and reinstall with 'pip install --force-reinstall strip-ansi'.
Upgrade
Version history
0.1.1latest on PyPI · released Jun 20, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
strip-ansi — pip install strip-ansi · libregistry