Skip to main content

A module used to filter out profane and/or offensive language of your choosing!

Project description

cleanlang let's you filter out profane and/or offensive language with customizable options! This includes things like threshold, a line between whether something is close to profane or not profane!


DISCLAIMER

Our module's results vary depending on your settings. This module is also in beta as of 6/10/25. We are also not responsible for any harm according to the MIT license.


profanityfilter: (Creates a profanity filter class)

import cleanlang

profanebot = cleanlang.profanityfilter(['bad', 'word'], threshold=80) # (bad word list) (threshold at default set to 70)

Output:

No output

boolscan: (Determines whether or not a string contains profane language or not based on a boolean [True/False])

import cleanlang

pb = cleanlang.profanityfilter(['bad', 'word'], threshold=70)

print(pb.scan('this Woard is b@d'))

Output:

True

percentscan: (Determines whether or not a string contains profane language or not based on an integer percentage from 0-100)

import cleanlang

pb = cleanlang.profanityfilter(['word']) # (threshold won't do anything in this case)

print(pb.percentscan('werd'))

Output:

75

fillerscan: (Replaces any profane words with a filler of your choosing)

import cleanlang

pb = cleanlang.profanityfilter(['word'])

print(pb.fillerscan("Hello! Isn't this a cool word?", '[_]')) # _ (Filler)

Output:

Hello! Isn't this a cool [_]

Extras: If you would like a preset list of profanities, just do:

from cleanlang.extras import profanitylist

print(profanitylist)

Output:

view output at your own discretion 

dependencies:

  • fuzzywuzzy[speedup]

Thanks for reading, and enjoy cleanlang! :)

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

cleanlang-3.1.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cleanlang-3.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file cleanlang-3.1.tar.gz.

File metadata

  • Download URL: cleanlang-3.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for cleanlang-3.1.tar.gz
Algorithm Hash digest
SHA256 5d1b9b5ec296b58c3195e91acea4dfa5b6fe2963af7e07ff39287d226f8783cf
MD5 563dd3195103ec325ee894d64a11f00a
BLAKE2b-256 8c9ba5287e46536bb3815347443da1443bcbce8ef40be4129a79a8c4b2f4941b

See more details on using hashes here.

File details

Details for the file cleanlang-3.1-py3-none-any.whl.

File metadata

  • Download URL: cleanlang-3.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.2

File hashes

Hashes for cleanlang-3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4c32164400080947e60a64e12c8f229378cc3032b4aa4c2b06412c1058405ffe
MD5 4b0dfaf19ca5c58ba00b7c2e2aa4150c
BLAKE2b-256 ae107f22676695923269ad3026a61c656b15b77f1f4012f45e3ce088512122be

See more details on using hashes here.

Supported by

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