Skip to main content

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 = "Hello​World!"            # 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-joiner U+200C, joiner U+200D
  • Word joiner U+2060, BOM U+FEFF, soft hyphen U+00AD
  • Direction marks U+200E/U+200F, combining grapheme joiner U+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

noatmark_text_hygiene-0.2.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

noatmark_text_hygiene-0.2.0-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file noatmark_text_hygiene-0.2.0.tar.gz.

File metadata

  • Download URL: noatmark_text_hygiene-0.2.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.11.9

File hashes

Hashes for noatmark_text_hygiene-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d3bc2109f1f867bdb97d02202c91be7a84a939c97ddf4c72da336c100f3b190a
MD5 81e9545b22f66636d2b53857da77f41d
BLAKE2b-256 6ccf6a4419af21c807658e05d7c406797268683558caae41ea6e0a1a291d5927

See more details on using hashes here.

File details

Details for the file noatmark_text_hygiene-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for noatmark_text_hygiene-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d27d5d0a8a0debba11555fac1bd64cc1bb413945665942bf8b91e987ed9f8238
MD5 cce05547b64a95671969f9ec4a913fa8
BLAKE2b-256 d8a4c02b04af2f3e60f6d5df3965472afd06a3f6303a300e039b5970c2eb8512

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page