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.1.0.tar.gz (4.1 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.1.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

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

Hashes for noatmark_text_hygiene-0.1.0.tar.gz
Algorithm Hash digest
SHA256 773210f0f5a10cba063babc5bc293407a6e59792cd919e65d8eec6822df7b98f
MD5 6ffce5f7cc160fba3a4214917654ead0
BLAKE2b-256 74dcf06cf367a7f4c60898842410d2196c3a0cd19785655b0cd5f8e315bc16eb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for noatmark_text_hygiene-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 451110e4dc55df7e46ce99c0ecc7198ca9b25eb385a5ff28886017a25fc565dc
MD5 015b0d6808c56f1cf9272e089cbc65f7
BLAKE2b-256 bafb5c68aff4653e51b18309a645ac48397bf1f04443f3d700f48a08f27822a4

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