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.3.0.tar.gz (6.5 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.3.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: noatmark_text_hygiene-0.3.0.tar.gz
  • Upload date:
  • Size: 6.5 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.3.0.tar.gz
Algorithm Hash digest
SHA256 ac848e569705b6a6c510afb296860aa84f68afe4eb1a17fa36c5efe7e05bcde2
MD5 b4dfcb8a83d4c14990be7266ae5dc09f
BLAKE2b-256 9cc0a905126e25f3f831958fdfba1f933712a1f74e36648a944d77e5dcde4b4f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for noatmark_text_hygiene-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1ba19391d7e0cb36d1a031aac12c3ac26379ce526d652ea431b6bee4df4474b9
MD5 0f2f75a7c72780aa6eded312b1ddf7f4
BLAKE2b-256 cd0cfa203ad13625b780571aafaf7d41ddec6bb4d614fd2d0b6714cda32428ac

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