Skip to main content

Python profanity filter

Project description

Dictionary Profanity Filter

Build Status PyPI version

Python module for profanity filtering using dictionaries. It supports English and Russian languages out-of-the-box.

Requirements

  • Python 3.5 or higher

How to install

Use the following command to install the package using pip:

pip install dictionary-profanity-filter

How to use

Here are several examples of the module usage:

  • Creating ProfanityFilter instance:
from dictionary_profanity_filter import ProfanityFilter
profanity_filter = ProfanityFilter()
  • Adding custom words to censor:
profanity_filter.add_words(['censorship', 'blocking'])
profanity_filter.censor('I hate censorship and blocking!')
# Output: 'I hate ********** and ********!'
  • Detect bad words in the text:
profanity_filter.is_clean('Porn is a restricted word')
# Output: False
  • Removing word from custom dictionary:
profanity_filter.remove_word('blocking')
profanity_filter.censor('I hate censorship and blocking!')
# Output: 'I hate ********** and blocking!'

TODO

  • Write documentation
  • Write tests

Project details


Download files

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

Source Distribution

dictionary-profanity-filter-1.0.4.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file dictionary-profanity-filter-1.0.4.tar.gz.

File metadata

  • Download URL: dictionary-profanity-filter-1.0.4.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for dictionary-profanity-filter-1.0.4.tar.gz
Algorithm Hash digest
SHA256 6d141c5fddec6f210a6ce0467207a9b8d89f5ee4b5c58eb64560636fa1c6fc63
MD5 d4b46a2a90288a289d7327db80139620
BLAKE2b-256 bf7a44418f1488b3ed32b79207866b055ca4fc25b5696475735cee9283453b90

See more details on using hashes here.

File details

Details for the file dictionary_profanity_filter-1.0.4-py3-none-any.whl.

File metadata

  • Download URL: dictionary_profanity_filter-1.0.4-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.7

File hashes

Hashes for dictionary_profanity_filter-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 39a70111196ba43a52d64db352c332a8ebde78683d2ede4e9beabe7579811924
MD5 6750c6c491154f408cec495379026021
BLAKE2b-256 29fd7fad034c5043fa747232bde5244a586d0053a6f84abd4bcdf8aaa13f198d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page