Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

squeakycleantext

Latest version: v0.13.2

Overview

Last scanned
25 Nov 2026
Published
25 Nov 2026
PyPI package Publisher: rhnfzl
8 Stars
0 Forks
14 Versions
1.6K Downloads
Python Repo language

Scan summary

squeakycleantext was last scanned on 25 Nov 2026 at version 0.13.2. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 14 versions; the latest 5 were published within 4 days (22–25 Nov 2026).
  • Findings: No rules fired in version 0.13.2.
  • Downloads: 1,627 downloads.

Versions

14 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.13.2 LATEST 25 Nov 2026 No rules fired
0.13.1 23 Nov 2026 No rules fired
0.13.0 22 Nov 2026 No rules fired
0.12.0 22 Nov 2026 Not shown
0.11.0 22 Nov 2026 Not shown

No rules fired in 0.13.2

Findings

Findings for v0.13.2. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.13.2; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

SqueakyCleanText

PyPI Python package Python Versions License

Clean text and mask personal details before you index it for search, train a model, or share a dataset.

SqueakyCleanText (SCT) repairs text, masks the personal data it finds, and returns counts and warnings you can review. Use it on a string or batch, in an existing data pipeline, or to turn extracted document text into cleaned chunks. Choose the stages, providers, and privacy rules your workflow needs.

in:   I’m Anna Berg & my mail is anna@example.se. Order 4711 ships on 2024-05-01.
out:  I'm <PERSON> & my mail is <EMAIL>. Order 4711 ships on 2024-05-01.
      sct_language=ENGLISH  sct_pii_count=2  sct_pii_types=['EMAIL', 'PERSON']

in:   Bel +31 20 123 4567 voor Jan de Vries.
out:  Bel <PHONE> voor <PERSON>.
      sct_language=DUTCH  sct_pii_count=2  sct_pii_types=['PERSON', 'PHONE']

Review the output before sharing sensitive data. SCT can miss personal details.

What you can do

If you need to… Use SCT to…
Prepare text for training or retrieval Repair broken Unicode and decode HTML entities. The training preset preserves formatting and ordinary dates and numbers.
Protect personal data before sharing Combine format rules and entity models, then use placeholders, realistic replacements, or reversible tokens. Apply your own handling rules and field schemas.
Index PDFs or long documents Extract PDF text with page and table structure, clean it, and split the cleaned text into bounded chunks. Choose detector windows separately from the chunks you export.
Curate and audit a corpus Score records, review near-duplicate decisions, and generate a data card. Use explicit selection rules when you want to remove records.
Fit SCT into an existing workflow Use Python, JSONL and the CLI, structured records, Hugging Face datasets, DataTrove, LangChain, Haystack, or MCP. Batch model inference on CPU or supported GPUs.

SCT detects 75 languages. Name, place, and organisation coverage depends on the model and language. See language coverage and the documentation site.

Install

pip install squeakycleantext

Python 3.12 or newer. Add extras for what you use, for example pip install "squeakycleantext[datasets,gpu]":

Extra Why you need it
datasets, datatrove Clean Hugging Face datasets or DataTrove pipelines
langchain, haystack Clean documents in RAG pipelines
gpu Run NER on an NVIDIA GPU
synthetic Replace personal data with fake values
score, corpus Corpus scoring and near-duplicate selection, or native DataTrove curation with checkpoints
documents, ocr Extract PDF text with Docling, or cover image regions with an OCR provider
chunking Add Semchunk and Chonkie providers to built-in chunking
token-store, secrets Store encrypted reversible maps, or detect supported credential formats
gliner Your own entity labels, and ner_mode="pii" (58 PII labels)
mcp Run SCT as an MCP server for AI assistants

All extras: docs/INSTALL.md.

Quickstart

Try format-based masking from the command line without loading a name model.

printf 'Email maria@example.com' | sct-clean --no-ner
# Email <EMAIL>

For training and retrieval data, use the training preset. It repairs text and masks detected personal data. It preserves numbers, dates, HTML tags, case, and line breaks by default, subject to configured repairs and PII replacement.

from sct import TextCleaner, preset_config
from sct.score import score_record

cleaner = TextCleaner(cfg=preset_config("training"))
for r in cleaner.process_batch([
    "I’m Anna Berg &amp; my mail is anna@example.se. Order 4711 ships on 2024-05-01.",
    "Bel +31 20 123 4567 voor Jan de Vries.",
]):
    row = score_record(r)
    print(r.lm_text)
    print(row["sct_language"], row["sct_pii_count"], row["sct_pii_types"])
# -> I'm <PERSON> & my mail is <EMAIL>. Order 4711 ships on 2024-05-01.
# -> ENGLISH 2 ['EMAIL', 'PERSON']
# -> Bel <PHONE> voor <PERSON>.
# -> DUTCH 2 ['PERSON', 'PHONE']

The first run downloads the NER models.

A whole Hugging Face dataset (datasets extra). clean_dataset wraps Dataset.map: batch_size, num_proc and other map arguments pass through. output="new_column" keeps the original text next to the cleaned text_clean, and score=True adds the sct_* columns.

from datasets import Dataset
from sct.integrations.hf import clean_dataset

if __name__ == "__main__":
    ds = Dataset.from_dict({"text": ["Mail jan@example.nl", "Call Maria Chen on +44 20 7946 0958."]})
    ds = clean_dataset(ds, columns=["text"], output="new_column", score=True)
    print(ds[1]["text_clean"], ds[1]["sct_pii_types"])
    # -> Call <PERSON> on <PHONE>. ['PERSON', 'PHONE']

Full cleanup for classic ML. The default config (TextCleaner()) also replaces ID-shaped numbers, dates and HTML, and stat_text gives a lower-cased version without stopwords and punctuation:

from sct import TextCleaner

result = TextCleaner().process("I’m Anna Berg &amp; my mail is anna@example.se. Order 4711 ships on 2024-05-01.")
print(result.lm_text)    # -> I'm <PERSON> & my mail is <EMAIL>. Order <NUMBER> ships on <DATE>.
print(result.stat_text)  # -> person mail email number ships date

Use SCT in your pipeline

DataTrove. Install the pipeline adapter and the dependency for its JSONL reader and writer.

pip install "squeakycleantext[datatrove]" orjson

Put SCT after language and quality filters when you only want to clean the records you plan to keep.

from datatrove.executor import LocalPipelineExecutor
from datatrove.pipeline.readers import JsonlReader
from datatrove.pipeline.writers import JsonlWriter
from sct.integrations.datatrove import SCTCleaner

if __name__ == "__main__":
    LocalPipelineExecutor(
        pipeline=[JsonlReader("raw/"), SCTCleaner(), JsonlWriter("clean/")],
        tasks=1,
        workers=1,
    ).run()

Choose an entry point based on the data you already have.

Where Usage Docs
PDF text and tables extract_document, clean_document, and the optional DocumentExtractionRouter DOCUMENTS
Clean and chunk a document chunk_document(cleaner, text, max_size=1024) CHUNKING
LangChain SCTDocumentTransformer().transform_documents(docs) INTEGRATIONS
Haystack pipe.add_component("sct", SCTDocumentCleaner()) INTEGRATIONS
Ray, Spark, Polars, DuckDB, dlt, Daft clean_columns(handle, batch) RECIPES
JSON, DataFrames, existing chunks, streams, images JSON and table adapters, process_rag_chunks, streaming redactors, and redact_image ADAPTERS
Command line printf 'Email maria@example.com' \| sct-clean --no-ner ADAPTERS
Data card for a file sct-report data.jsonl --text-column text --out report.json --card card.md SCORE
AI assistants sct-mcp (MCP server, mcp extra) MCP

The framework adapters use the training preset unless you pass a config. They build one cleaner per worker process. Check worker memory and adapter limits before raising concurrency. Use direct text processing when you need a reversible map.

Clean a document and produce chunks

Use chunk_document() to clean the full document before you split it for search, training, or export.

from sct import TextCleaner, TextCleanerConfig, chunk_document

cleaner = TextCleaner(TextCleanerConfig(check_ner_process=False))
result = chunk_document(cleaner, "Contact alice@example.com for details.", max_size=24)
texts = [chunk.text for chunk in result.chunks]
assert "alice@example.com" not in "".join(texts)

SCT can use Markdown headings or cleaned document elements as boundaries. Install SqueakyCleanText[chunking] for Semchunk and Chonkie, or register your own splitter. In unified PII processing, you can also choose a chunker for each compatible detector. See chunking providers and routing.

How the stages fit together

  • Prepare the input. Pass text directly, use a record adapter, or extract a document into text elements with available page and table information.
  • Detect and protect. Configure normalization, language detection, format rules and models through TextCleanerConfig. Use the unified mode to apply one privacy policy across detectors and track source ranges.
  • Use the result. Return cleaned text, split it into output chunks, or score and select records for a corpus. Output chunks and detector windows serve separate stages.

The legacy pipeline remains the default. See configuration for presets, batch settings and migration to unified processing.

What you get back

process and process_batch return a ProcessResult:

  • lm_text: cleaned text for LLMs, retrieval, and training.
  • stat_text: lower-cased, without stopwords and punctuation, for classic ML models.
  • language: the detected language.
  • signals: a value-free view with the same keys for every input: language and confidence, pii_count, pii_share, pii_types, sensitive (pii_count > 0), warnings and the NER models that ran. Use these fields for quality checks without logging matched values.
  • metadata: the same counts, plus raw values only when you ask for them (the reversible map, or findings with include_entities=True). Keep those out of logs.

score_record turns a result into flat sct_* columns for filtering and data cards. ScoreConfig adds an optional quality score and a MinHash signature. Fields: docs/API.md, columns: docs/SCORE.md.

PII mode Output Use it for
placeholder (default) <PERSON> lives in <LOCATION>. Training and RAG data
synthetic (synthetic extra) Fake values, for example Patty Hunter lives in East Bobbyfurt. (the same document always gets the same fakes) Data that must still read naturally
reversible <PERSON_0> lives in <LOCATION_0>. plus a map Sending text to an LLM and restoring the answer

Modes, privacy policies and more PII types (ner_mode="pii"): docs/REPLACEMENT_MODES.md, docs/PRIVACY.md, docs/NER_BACKENDS.md.

One policy across detectors (opt-in)

Unified processing lets you apply the same handling rules to format matches and model findings. Existing callers keep pii_processing="legacy" by default.

from sct import TextCleaner, TextCleanerConfig, UnifiedPrivacyPolicy, HandlingRule

cleaner = TextCleaner(
    TextCleanerConfig(pii_processing="unified", check_ner_process=False),
    unified_policy=UnifiedPrivacyPolicy("contact-policy", "1", {
        "EMAIL": HandlingRule(action="redact"),
    }),
)
result = cleaner.process("Contact alice@example.com")
assert "alice@example.com" not in result.lm_text

All selected detectors inspect the same prepared text. An application can register its own detectors and select them with detector_specs. Use custom_allow_terms, custom_deny_terms, or custom_patterns for your own terms and patterns. The policy can keep a finding, replace it using the selected mode, or redact it without storing the value in a reversible map. See detector selection and network permissions and policy behavior.

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • pypi-releases squeakycleantext

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Frame 2085668439 (1)
Group 1261154229