
Security News
Cloudflare Introduces a Faster TypeScript Compiler Written in Rust
Cloudflare introduces tsrs, a Rust port of TypeScript’s compiler promising faster checks and lower memory use, with the TypeScript team’s help.
cleanup-string
Advanced tools
Affected versions:
String-cleanup utilities exposed through a single client class.
cleanup() singleton — create it,
then call its methods.py.typed). Installable with pip on Python 3.9 – 3.13.python -m pip install cleanup-string
from cleanup_string import cleanup
client = cleanup() # singleton — always the same instance
client.strip(" hi ") # 'hi'
client.collapse_whitespace("a b\t c") # 'a b c'
client.slugify("Héllo, World!") # 'hello-world'
client.to_snake_case("camelCaseString") # 'camel_case_string'
client.strip_accents("café résumé") # 'cafe resume'
client.remove_html_tags("<p>Hi <b>x</b>") # 'Hi x'
client.clean(" messy\t\ttext\r\nhere ") # 'messy text here'
cleanup() is a singleton: calling it again anywhere returns the
same instance.
assert cleanup() is cleanup() # True
| Method | What it does |
|---|---|
strip(s) | Trim leading/trailing whitespace |
collapse_whitespace(s) | Collapse whitespace runs to a single space + trim |
remove_whitespace(s) | Remove all whitespace |
normalize_newlines(s) | \r\n / \r → \n |
remove_control_chars(s) | Drop control chars (keeps tab/newline/CR) |
remove_html_tags(s) | Strip <...> tags |
remove_urls(s) | Remove http(s):// / www. URLs |
remove_punctuation(s) | Remove Unicode punctuation |
remove_digits(s) | Remove digits |
remove_non_ascii(s) | Drop non-ASCII characters |
normalize_unicode(s, form="NFC") | Unicode normalisation |
strip_accents(s) | Remove diacritics (café → cafe) |
to_snake_case(s) | snake_case |
to_kebab_case(s) | kebab-case |
to_camel_case(s) | camelCase |
slugify(s) | Lowercase hyphenated URL slug |
truncate(s, length, suffix="…") | Truncate with a suffix |
clean(s) | Normalise + de-control + collapse whitespace |
MIT — see LICENSE.
FAQs
String-cleanup utilities.
We found that cleanup-string demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.

Security News
Cloudflare introduces tsrs, a Rust port of TypeScript’s compiler promising faster checks and lower memory use, with the TypeScript team’s help.

Security News
The PHP Foundation says Chainguard broke a security embargo ahead of critical RCE patches, as leaks disrupted the coordinated release.

Security News
PHP releases emergency patches for two critical RCE vulnerabilities as agencies urge organizations to take unpatched sites offline.