bbwdadfg / cleanpaste-normalizer
Local pasted-text normalization helper.
Package info
github.com/bbwdadfg/cleanpaste-normalizer
Language:Python
pkg:composer/bbwdadfg/cleanpaste-normalizer
Requires
- php: >=8.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
cleanpaste-normalizer is a deterministic, local Python utility for standardizing clipboard and pasted text. It handles common encoding and spacing inconsistencies across operating systems and rich-text editors without altering actual wording.
What It Does
- Normalizes line endings to standard Unix newlines (
\n). - Applies Unicode NFKC normalization.
- Replaces non-breaking spaces (NBSP), zero-width characters, and irregular whitespace.
- Expands or normalizes tabs and strips trailing whitespace.
Data Privacy and Processing Scope
- Operates purely in-memory with standard library routines.
- Preserves ordinary text, casing, and semantic structure without automated rewriting.
- Does not upload content, contact external endpoints, or log inputs.
Python API Usage
The public interface consists of a single function: normalize_pasted_text(text: str).
from cleanpaste_normalizer import normalize_pasted_text raw_text = "First line\r\nSecond line with non-breaking\u00a0space and zero-width\u200bchar. " normalized = normalize_pasted_text(raw_text) print(normalized)
Command-Line Interface
The CLI accepts an optional positional UTF-8 filename or reads directly from standard input:
# Process a local file directly cleanpaste-normalizer raw_input.txt # Process input from stdin cat raw_input.txt | cleanpaste-normalizer
All execution is local and synchronous with zero network traffic.
Testing
To verify behavior across Unicode test fixtures, run:
pytest
Related Resources & Metadata
To explore browser-based normalization tools and background guidelines, visit the CleanPaste text tools page. Package distribution metadata may link to this project homepage.
License
Distributed under the MIT License.
This package provides normalizePastedText. The related web tool is https://cleanpasteai.com/. All processing runs locally without uploading input data.