alt-profanity-check
A fast, robust library to check for offensive language in strings. Dropdown replacement of "profanity-check".
What it is and what it does
Alt-profanity-check is a maintained fork providing fast offensive-language detection for Python applications. It uses a linear SVM model trained on 200k labeled text samples from hate-speech and toxic-comment datasets, combined with scikit-learn's CountVectorizer and LinearSVC to classify input strings as offensive or clean. The package returns either binary predictions (0 or 1) or probability scores, making it suitable for content moderation pipelines.
The library trades some accuracy for speed compared to more sophisticated NLP approaches, but avoids the brittleness of hard-coded word blacklists. It depends on scikit-learn and joblib, and the maintainer aligns package versions with scikit-learn releases to ensure model compatibility. The package is actively maintained and requires Python 3.11 or newer; older Python versions require pinning to specific package versions.
Use it for:
- Filter user-generated comments or forum posts in real time to flag potentially offensive content for review.
- Pre-screen chat messages or social media content in moderation workflows before human review.
- Detect toxic language in customer support tickets or feedback to route sensitive cases appropriately.
- Classify text datasets for research on hate speech or offensive language patterns.
- Implement content policies in multiplayer games or collaborative platforms by scoring text submissions.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Detects offensive or profane language in text strings using a machine-learning model trained on labeled datasets, returning binary classifications or probability scores.
Yes, if you need fast, model-based profanity detection and can target Python 3.11+. The package is actively maintained, has no known vulnerabilities, and offers better accuracy than blacklist-based alternatives with minimal install friction. The main trade-off is the strict Python version requirement and scikit-learn version pinning; treat predictions as heuristics, not ground truth, and test on your specific use case before deploying.
Install
alt-profanity-check on PyPI
pip
pip install alt-profanity-checkuv
uv add alt-profanity-checkpoetry
poetry add alt-profanity-checkInstalling alt-profanity-check
Before you install
Low friction: pure Python wheel with only scikit-learn and joblib as runtime dependencies. Actively maintained with a release 64 days ago; requires Python 3.11 or newer, which may constrain adoption on older codebases.
License in practice
MIT license (permissive); you can use, modify, and distribute this package freely with minimal legal restrictions.
Quickstart
pip install alt-profanity-check
from alt-profanity-check import predict, predict_prob
predict(['fuck you'])
# [1]
predict_prob(['go to hell, you scum'])
# [0.7618861]
Requires Python 3.11 or newer; scikit-learn version must match the package version (e.g., alt-profanity-check 1.9.0 expects scikit-learn 1.9.0).
Verify before relying
- Whether the package's scikit-learn version pinning strategy is enforced strictly or merely recommended.
- Current accuracy metrics on modern datasets; the description cites benchmarks from December 2018.
- Whether the command-line interface is available in the current version.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.11) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 2 — scikit-learn, joblib |
| Maintenance | actively maintained — 64 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 324,852/month — #7,591 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: alt_profanity_check-1.9.0-py3-none-any.whl
Tags
More Linguistic packages
Detects and normalizes text encoding from…
permissive · top 100 on PyPI
tiktokentiktoken is a fast BPE tokenizer that converts…
permissive · top 1,000 on PyPI
chardetDetects character encoding and language in byte…
permissive · top 1,000 on PyPI
text-unidecodeConverts Unicode text to ASCII by…
copyleft · top 1,000 on PyPI
larkLark is a parsing library that builds abstract…
permissive · top 1,000 on PyPI
tree-sitterPython bindings to the tree-sitter parsing…
permissive · top 1,000 on PyPI
better-profanityDetects and censors profanity in text,…
permissive · top 5,000 on PyPI
detoxifyDetoxify classifies text comments for toxic…
permissive · top 15,000 on PyPI
fasttextfastText is a library for learning word…
permissive · top 5,000 on PyPI
fasttext-wheelfasttext-wheel provides Python bindings for…
permissive · top 5,000 on PyPI
fasttext-numpy2fasttext-numpy2 provides Python bindings for…
permissive · top 5,000 on PyPI
gibberish-detectorDetects whether strings are gibberish or valid…
permissive · top 15,000 on PyPI
lingua-language-detectorDetects which language a text is written in,…
permissive · top 5,000 on PyPI
keyphrase-vectorizersExtracts keyphrases from text documents using…
permissive · top 15,000 on PyPI
confusablesDetects and matches words that appear identical…
permissive · top 15,000 on PyPI
wordfreqwordfreq looks up word frequencies across over…
permissive · top 5,000 on PyPI