better-profanity
Blazingly fast cleaning swear words (and their leetspeak) in strings
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.* support as declared in package metadata.
- 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 · maintenance · safety
permissive license (permissive) — MIT license permits commercial and private use with minimal restrictions; you must include a copy of the license in distributions.
last release 2020-11-02 (2111 days) · last repo commit 2024-05-23 · 232 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,678,810 downloads/mo, #3,659 on PyPI
Alternatives
Verify before relying
from better_profanity import profanity
profanity.load_censor_words()
text = "You p1ec3 of sHit."
censored = profanity.censor(text)
print(censored) # You **** of ****.- 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.
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 on this page. Verify before relying on it.
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
better-profanity on PyPI
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.
Requires Python 3.* support as declared in package metadata.
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 ****.
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 | permissive license permissive |
| Python support | Supports the current Python release ==3.* |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Dormant 2,111 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,678,810 / month, #3,659 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: better_profanity-0.7.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “profanity filter”
- better-profanityDetects and censors profanity in text, including leetspeak variations…
- alt-profanity-checkDetects offensive or profane language in text strings using a…
- retrieBuilds efficient Trie-based regex patterns for fast matching and…
Give your agent the search over MCP, or paste the wish link into any chat.
More Text Processing packages
A drop-in replacement for Python's standard `re` module that adds advanced regex features like nested sets, fuzzy matching, lookaround in conditionals, and full Unicode case-folding while maintaining backward compatibility.
pyparsing provides a library for building text parsers directly in Python code using composable grammar classes, handling quoted strings, whitespace variation, and embedded comments without regex or lex/yacc.
Install it if you need to parse text or define grammars programmatically.
fonttools manipulates font files in multiple formats (TrueType, OpenType, AFM, Type 1, Mac-specific) and includes TTX, a tool to convert fonts to and from XML text format.
Install it if you need to read, write, or manipulate fonts programmatically or via the TTX command-line tool.
Docutils converts plaintext documentation in reStructuredText format into multiple output formats including HTML, XML, and LaTeX using a modular processing system.
RapidFuzz provides fast fuzzy string matching using Levenshtein Distance and related metrics, implemented mostly in C++ with Python bindings for rapid similarity scoring and approximate string matching.
Install it if you need fuzzy string matching; it's a solid replacement for FuzzyWuzzy with better licensing and performance.
tinycss2 parses CSS strings into token and block objects, and generates CSS strings from those objects, following the CSS Syntax Level 3 specification without enforcing specific properties or values.
Install it if your project requires CSS tokenization or syntax manipulation.
See also alt-profanity-check · codespell · pyspellchecker · confusables · wonderwords · stop-words · sanitize-filename · textsearch · confusable-homoglyphs · xkcdpass