Skip to main content

profanityfilter

Build Status

A universal Python library for detecting and/or filtering profane words.

PyPI: https://pypi.python.org/pypi/profanityfilter
Doc: https://areebbeigh.github.io/profanityfilter/

Installation

> pip install profanityfilter

Usage

from profanityfilter import ProfanityFilter

pf = ProfanityFilter()

pf.censor("That's bullshit!")
> "That's ********!"
pf.set_censor("@")
pf.censor("That's bullshit!")
> "That's @@@@@@@@!"
pf.define_words(["icecream", "choco"])
pf.censor("I love icecream and choco!")
> "I love ******** and *****"
pf.is_clean("That's awesome!")
> True
pf.is_clean("That's bullshit!")
> False
pf.is_profane("Profane shit is not good")
> True

pf_custom = ProfanityFilter(custom_censor_list=["chocolate", "orange"])
pf_custom.censor("Fuck orange chocolates")
> "Fuck ****** **********"

pf_extended = ProfanityFilter(extra_censor_list=["chocolate", "orange"])
pf_extended.censor("Fuck orange chocolates")
> "**** ****** **********"

Console Executable

profanityfilter -h
> usage: profanityfilter-script.py [-h] [-t TEXT | -f PATH] [-o OUTPUT_FILE]
>                                  [--show]
>
> Profanity filter console utility
>
> optional arguments:
>   -h, --help            show this help message and exit
>   -t TEXT, --text TEXT  Test the given text for profanity
>   -f PATH, --file PATH  Test the given file for profanity
>   -o OUTPUT_FILE, --output OUTPUT_FILE
>                         Write the censored output to a file
>   --show                Print the censored text

Contributing

  • Fork
  • Add changes
  • Add unit tests
  • Make a pull request :)

I encourage you to fork this repo and expand it in anyway you like. Pull requests are welcomed!

Additional Info

Developer: Areeb Beigh areebbeigh@gmail.com
GitHub Repo: https://github.com/areebbeigh/profanityfilter/

Metadata

Release files for profanityfilter 2.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for profanityfilter 2.1.0
File Size Uploaded
profanityfilter-2.1.0.tar.gz 7.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for profanityfilter 2.1.0
File Interpreter ABI Platform
profanityfilter-2.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 15.4 kB

Release files / profanityfilter-2.1.0.tar.gz

Download URL profanityfilter-2.1.0.tar.gz
Size 7.9 kB
Tags Source
SHA-256 checksum
How to use checksums
0ede04e92a9d7255faa52b53776518edc6586dda828aca677c74b5994dfdd9d8
BLAKE2b-256 checksum
How to use checksums
8d0308740b5e0800f9eb9f675c149a497a3f3735e7b04e414bcce64136e7e487
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2024.

Transparency log

Release files / profanityfilter-2.1.0-py2.py3-none-any.whl

Download URL profanityfilter-2.1.0-py2.py3-none-any.whl
Size 7.5 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
e1bc07012760fd74512a335abb93a36877831ed26abab78bfe31bebb68f8c844
BLAKE2b-256 checksum
How to use checksums
8803eb18f72dc6e6398e75e3762677f18ab3a773a384b18efd3ed9119844e892
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/5.1.1 CPython/3.12.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 25, 2024.

Transparency log

Release history Release notifications | RSS feed

This release

2.1.0 This release

2 release files

2.0.6

2 release files

2.0.5

2 release files

2.0.4

2 release files

2.0.3

2 release files

2.0.2

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1

3 release files

1.0

3 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page