Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/areebbeigh/profanityfilter
A universal Python library for detecting and filtering profanity
https://github.com/areebbeigh/profanityfilter
profanity profanity-detection profanityfilter universal-python-library
Last synced: 8 days ago
JSON representation
A universal Python library for detecting and filtering profanity
- Host: GitHub
- URL: https://github.com/areebbeigh/profanityfilter
- Owner: areebbeigh
- License: bsd-3-clause
- Created: 2016-09-21T15:17:39.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-03-15T04:51:26.000Z (8 months ago)
- Last Synced: 2024-09-19T23:12:29.080Z (about 2 months ago)
- Topics: profanity, profanity-detection, profanityfilter, universal-python-library
- Language: Python
- Homepage: https://pypi.python.org/pypi/profanityfilter
- Size: 689 KB
- Stars: 73
- Watchers: 2
- Forks: 25
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# profanityfilter
[![Build Status](https://travis-ci.org/areebbeigh/profanityfilter.svg?branch=master)](https://travis-ci.org/areebbeigh/profanityfilter)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 ProfanityFilterpf = 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")
> Truepf_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
GitHub Repo: https://github.com/areebbeigh/profanityfilter/