--- id: better-profanity version: "0.7.0" license: unclear license_treatment: permissive maintenance: dormant --- # better-profanity — Blazingly fast cleaning swear words (and their leetspeak) in strings License: permissive · Maintenance: dormant · Downloads: 1.7M/mo ## What it is and what it does better_profanity is a string-based profanity filter that replaces swear words and their common leetspeak variants (like p0rn, h4NDjob) with asterisks or a custom character. It works by loading a wordlist and generating all common character substitutions, then checking for matches using direct string comparison rather than regex. The package has no runtime dependencies and installs as a pure Python wheel. The library handles word boundaries loosely—it censors profanity separated by spaces, underscores, commas, and periods, but preserves @, $, *, ", and ' as non-separators. You can load the built-in wordlist, supply a custom list, load from a file, add words dynamically, or whitelist specific terms. It includes a `contains_profanity()` check to detect without censoring. The package is dormant (last updated 2020-11-02). Use it for: - Filter user-generated content in forums, chat systems, or comment sections before display. - Detect profanity in moderation workflows to flag posts for human review. - Clean text datasets for machine learning training to remove offensive language. - Censor profanity in real-time messaging or live-chat applications. - Build custom content policies by loading domain-specific wordlists and whitelists. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Detects and censors profanity in text, including leetspeak variations like p0rn and h4NDjob, using fast string comparison instead of regex. Yes, if you need a lightweight, zero-dependency profanity filter. Low install friction and permissive license make integration straightforward. However, maintenance is dormant since 2020-11-02, so the wordlist and codebase are not actively updated. The package has documented limitations: it can be bypassed by adding extra characters, and compound words with non-space separators are not filtered. Use for basic content moderation or as a first-pass filter. ## Install pip install better-profanity uv add better-profanity poetry add better-profanity ## Installing better-profanity Before you install: Low friction: pure Python wheel with no runtime dependencies. Maintenance is dormant—last release was 2020-11-02, over 2111 days ago—so expect no active bug fixes or updates. License in practice: MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license in distributions. Quickstart: from better_profanity import profanity profanity.load_censor_words() text = "You p1ec3 of sHit." censored = profanity.censor(text) print(censored) # You **** of ****. Requires Python 3.* support as declared in package metadata. Verify before relying: - Whether the default wordlist reflects current profanity coverage or remains static from 2020. - Performance characteristics on very large texts or high-frequency filtering workloads. - Unicode support limitations beyond stated exclusion of Chinese; which other languages are unsupported. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 1.7M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags profanity filter, censor swear words, text content moderation, leetspeak profanity detection, bad word filter, content filtering library, profanity detection, content-moderation, text-filtering [View on SkillFed](https://skillfed.io/packages/better-profanity) · [View on PyPI](https://pypi.org/project/better-profanity/)