expletives
Curated profanity lists with provenance, classification, and simple matching helpers, merged from 41 public wordlists across 15 languages.
pip install expletives
Usage
>>> import expletives
>>> expletives.is_expletive("fuck")
True
>>> expletives.is_expletive("asian") # curated false-positive
False
>>> expletives.contains_expletive("hello world")
False
>>> expletives.find_expletives("this shit is fucked")
[Match(word='shit', start=5, end=9), Match(word='fucked', start=13, end=19)]
>>> expletives.censor("oh shit, fuck!")
'oh ****, ****!'
>>> expletives.censor("oh shit", mask="[BEEP]")
'oh [BEEP]'
Rich metadata for every entry:
>>> expletives.catalog["fuck"]["sources"][:3]
['2600-googleblacklist', 'bannedwordlist', 'biglou-bad-words']
>>> expletives.catalog["fuck"]["classification"]
'term'
>>> expletives.explain_okayish("asian")
'nationality / ethnicity / geographic descriptor'
Filter by source or language:
>>> expletives.load(sources=["seven-dirty-words"])
{'cocksucker', 'cunt', 'fuck', 'motherfucker', 'piss', 'shit', 'tits'}
>>> len(expletives.load(language="ja"))
180
Module attributes
| name | type | description |
|---|---|---|
badwords |
set[str] |
merged words, wildcards excluded |
patterns |
set[str] |
wildcard entries (*fuck*, …) |
okayish |
list[str] |
curated false-positive allow-list |
catalog |
dict[str, dict] |
full entry metadata (see SOURCES.md) |
sources |
dict[str, dict] |
per-source metadata |
classifications |
tuple[str, ...] |
valid classification ids |
Functions
| function | returns |
|---|---|
is_expletive(word, allow_okayish=True) |
bool |
contains_expletive(text) |
bool |
find_expletives(text) |
list[Match] |
censor(text, mask="*") |
str |
load(sources=None, language=None, ...) |
set[str] |
describe(word) / classify(word) |
str | None |
explain_okayish(word) |
str | None |
Sources & licensing
See SOURCES.md for every bundled wordlist, its origin, and sources we evaluated but didn't include.
Apache 2.0. The bundled source files retain their upstream licenses as noted in each file's header.
Release files for expletives 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| expletives-0.1.0.tar.gz | 248.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| expletives-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 520.6 kB
Release files / expletives-0.1.0.tar.gz
| Download URL | expletives-0.1.0.tar.gz |
|---|---|
| Size | 248.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f8bc07d6a885f6e349a3b01a674bfcd297c0af157a4c0f5f82aa56929c971401
|
|
BLAKE2b-256 checksum How to use checksums |
06232032e01e088eb24ff0b9a0c7718188e396a7c5787b84a73c9debb156b118
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.12
|
Release files / expletives-0.1.0-py3-none-any.whl
| Download URL | expletives-0.1.0-py3-none-any.whl |
|---|---|
| Size | 271.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
36badf40e1d9896b28c647f4f831483bdb8b1b090a35068c49067793ae3db87e
|
|
BLAKE2b-256 checksum How to use checksums |
ee3b9747e438f258c042d9d83fd3ef752828f145c40784ff7e26ad70879cf463
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.12
|