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
Release files for noatmark-text-hygiene 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| noatmark_text_hygiene-0.3.0.tar.gz | 6.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| noatmark_text_hygiene-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.4 kB
Release files / noatmark_text_hygiene-0.3.0.tar.gz
| Download URL | noatmark_text_hygiene-0.3.0.tar.gz |
|---|---|
| Size | 6.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac848e569705b6a6c510afb296860aa84f68afe4eb1a17fa36c5efe7e05bcde2
|
|
BLAKE2b-256 checksum How to use checksums |
9cc0a905126e25f3f831958fdfba1f933712a1f74e36648a944d77e5dcde4b4f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|
Release files / noatmark_text_hygiene-0.3.0-py3-none-any.whl
| Download URL | noatmark_text_hygiene-0.3.0-py3-none-any.whl |
|---|---|
| Size | 7.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1ba19391d7e0cb36d1a031aac12c3ac26379ce526d652ea431b6bee4df4474b9
|
|
BLAKE2b-256 checksum How to use checksums |
cd0cfa203ad13625b780571aafaf7d41ddec6bb4d614fd2d0b6714cda32428ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.11.9
|