Changelog
0.2.0 (unreleased)
Same word lists and matching rules as the JavaScript package 0.2.0.
- Many more English words, including slurs (
fag,faggot,nigger…) and compounds (shitface,dipshit,jackass…), and more Romanized and Devanagari Nepali words (jhant,lauda,chhinal,gadha,ullu…). - New English words at the strict level that are also ordinary words:
damn,cum,prick,hoeand others. shitis now a stem, soshitfaceandshittingare caught. Names that start with it, like Shitij and Shital, are on the allow list.- A built-in allow list of names and ordinary words, like Randip, Shitij, conditions and Scunthorpe, that are never flagged. The strict level no longer flags them.
- A few roots, like
fuckandbitch, are caught inside a longer word:dumbfuck,sonofabitch. xis read aschhin Romanized Nepali, soxakkamatcheschhakka.chhod("leave") andchhodnuare no longer flagged by the stemchod.- Words split by punctuation without a space are read joined:
sh.it,fu-ck. - Accents and Cyrillic or Greek look-alike letters are removed or replaced:
fück,fuсk.8reads asb,9asgand€ase. extra_wordsoption to flag more words, andallow_wordsoption to never flag a word.
0.1.0 (2026-09-25)
First release, with the same word lists and matching rules as the JavaScript package 0.1.0.
contains_profanity,find_profanityandtokenize.censorto mask matches in place, with a custommaskcharacter or areplacefunction.checkto scan once, then inspect and censor the result:check(text).censor().find_profanity_matchesto get each match with its position in the original text.create_filterfor reusing one set of options.languagesoption to check English, Romanized Nepali and Devanagari separately.strictnessoption with three levels:"lenient","standard"(default) and"strict".- Handles leetspeak,
!and*in place of letters, stretched letters and spelled-out letters. - Handles Nepali postpositions and plurals in both scripts.
- Multi-word phrases in both scripts.
- A
lexiconmodule with every entry tagged by language and strictness. - Python 3.9 or later, no dependencies.