NoAtMark Text Hygiene
Strip invisible characters (zero-width spaces, joiners, BOMs, variation selectors) and clean LLM formatting artifacts — the Python companion to noatmark.com.
Dependency-free, pure Python, works offline.
Install
pip install noatmark-text-hygiene
Usage
from noatmark_text_hygiene import scan, strip, clean_llm_text
# Count invisible / zero-width characters
text = "HelloWorld!" # contains a ZWSP and a BOM
result = scan(text)
print(result["count"]) # 2
# Remove them
clean = strip(text)
print(clean) # "HelloWorld!"
# Clean LLM formatting junk (CRLF, blank lines, deep headings, stray fences)
messy = "####### Head\r\n\r\n\r\nText with spaces.\r\n```"
r = clean_llm_text(messy)
print(r["cleaned"]) # "### Head\n\nText with spaces.\n```"
What it strips
- Zero-width space
U+200B, non-joinerU+200C, joinerU+200D - Word joiner
U+2060, BOMU+FEFF, soft hyphenU+00AD - Direction marks
U+200E/U+200F, combining grapheme joinerU+034F - Variation selectors, special spaces, non-breaking space
Honest scope
This removes invisible Unicode characters and formatting artifacts. It does not and cannot remove statistical AI text watermarks (those require the model provider's private key). See noatmark.com for why.
License
MIT
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file noatmark_text_hygiene-0.1.0.tar.gz.
File metadata
- Download URL: noatmark_text_hygiene-0.1.0.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
773210f0f5a10cba063babc5bc293407a6e59792cd919e65d8eec6822df7b98f
|
|
| MD5 |
6ffce5f7cc160fba3a4214917654ead0
|
|
| BLAKE2b-256 |
74dcf06cf367a7f4c60898842410d2196c3a0cd19785655b0cd5f8e315bc16eb
|
File details
Details for the file noatmark_text_hygiene-0.1.0-py3-none-any.whl.
File metadata
- Download URL: noatmark_text_hygiene-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/7.0.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
451110e4dc55df7e46ce99c0ecc7198ca9b25eb385a5ff28886017a25fc565dc
|
|
| MD5 |
015b0d6808c56f1cf9272e089cbc65f7
|
|
| BLAKE2b-256 |
bafb5c68aff4653e51b18309a645ac48397bf1f04443f3d700f48a08f27822a4
|