Skip to main content
Help the Python Software Foundation raise $60,000 USD by December 31st!  Building the PSF Q4 Fundraiser

Obscene words filter for python, built on regexp for Russian language.

Project description

Python obscene words filter.

Python 2.7 pypi MIT License

This is ultra simple words filter, based on regular expressions. It is built on regular expressions, with Russian language support from the box.

It may work with your language too (if you will write your own regular expressions).

Before using in production, you should test it, because there are no swear words filter in the world that does well filtering, so the quality is not 100%.

But test coverage is :)


Sample code:

from obscene_word_filter.default import get_default_filter

f = get_default_filter()


from obscene_word_filter import conf
from obscene_word_filter.words_filter import ObsceneWordsFilter

f = ObsceneWordsFilter(conf.bad_words_re, conf.good_words_re)

Then you can mask use input:

f.mask_bad_words("Тут должны быть матерные слова.")
>>> Тут должны быть ******** *****.


Just read the tests :)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for python-obscene-words-filter, version 0.1.6
Filename, size File type Python version Upload date Hashes
Filename, size python-obscene-words-filter-0.1.6.tar.gz (8.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page