# 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.
<b>PyPI:</b> https://pypi.python.org/pypi/profanityfilter<br>
<b>Doc:</b> 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><br>
GitHub Repo: https://github.com/areebbeigh/profanityfilter/
Raw data
{
"_id": null,
"home_page": "https://github.com/areebbeigh/profanityfilter",
"name": "profanityfilter",
"maintainer": null,
"docs_url": null,
"requires_python": null,
"maintainer_email": null,
"keywords": "profanity filter clean content",
"author": "Areeb Beigh",
"author_email": "areebbeigh@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/8d/03/08740b5e0800f9eb9f675c149a497a3f3735e7b04e414bcce64136e7e487/profanityfilter-2.1.0.tar.gz",
"platform": null,
"description": "# profanityfilter\n[![Build Status](https://travis-ci.org/areebbeigh/profanityfilter.svg?branch=master)](https://travis-ci.org/areebbeigh/profanityfilter)\n\nA universal Python library for detecting and/or filtering profane words.\n\n\n<b>PyPI:</b> https://pypi.python.org/pypi/profanityfilter<br>\n<b>Doc:</b> https://areebbeigh.github.io/profanityfilter/\n\n# Installation\n\n`> pip install profanityfilter`\n\n# Usage\n\n```\nfrom profanityfilter import ProfanityFilter\n\npf = ProfanityFilter()\n\npf.censor(\"That's bullshit!\")\n> \"That's ********!\"\npf.set_censor(\"@\")\npf.censor(\"That's bullshit!\")\n> \"That's @@@@@@@@!\"\npf.define_words([\"icecream\", \"choco\"])\npf.censor(\"I love icecream and choco!\")\n> \"I love ******** and *****\"\npf.is_clean(\"That's awesome!\")\n> True\npf.is_clean(\"That's bullshit!\")\n> False\npf.is_profane(\"Profane shit is not good\")\n> True\n\npf_custom = ProfanityFilter(custom_censor_list=[\"chocolate\", \"orange\"])\npf_custom.censor(\"Fuck orange chocolates\")\n> \"Fuck ****** **********\"\n\npf_extended = ProfanityFilter(extra_censor_list=[\"chocolate\", \"orange\"])\npf_extended.censor(\"Fuck orange chocolates\")\n> \"**** ****** **********\"\n```\n\n# Console Executable\n\n```\nprofanityfilter -h\n> usage: profanityfilter-script.py [-h] [-t TEXT | -f PATH] [-o OUTPUT_FILE]\n> [--show]\n>\n> Profanity filter console utility\n>\n> optional arguments:\n> -h, --help show this help message and exit\n> -t TEXT, --text TEXT Test the given text for profanity\n> -f PATH, --file PATH Test the given file for profanity\n> -o OUTPUT_FILE, --output OUTPUT_FILE\n> Write the censored output to a file\n> --show Print the censored text\n```\n\n# Contributing\n\n- Fork\n- Add changes\n- Add unit tests\n- Make a pull request :)\n\nI encourage you to fork this repo and expand it in anyway you like. Pull requests are welcomed!\n\n# Additional Info\nDeveloper: Areeb Beigh <areebbeigh@gmail.com><br>\nGitHub Repo: https://github.com/areebbeigh/profanityfilter/\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "A universal Python library for detecting and/or filtering profane words.",
"version": "2.1.0",
"project_urls": {
"Homepage": "https://github.com/areebbeigh/profanityfilter"
},
"split_keywords": [
"profanity",
"filter",
"clean",
"content"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8803eb18f72dc6e6398e75e3762677f18ab3a773a384b18efd3ed9119844e892",
"md5": "3f97f95f5ff0a6fe056f4387c89ff089",
"sha256": "e1bc07012760fd74512a335abb93a36877831ed26abab78bfe31bebb68f8c844"
},
"downloads": -1,
"filename": "profanityfilter-2.1.0-py2.py3-none-any.whl",
"has_sig": false,
"md5_digest": "3f97f95f5ff0a6fe056f4387c89ff089",
"packagetype": "bdist_wheel",
"python_version": "py2.py3",
"requires_python": null,
"size": 7483,
"upload_time": "2024-11-25T22:31:50",
"upload_time_iso_8601": "2024-11-25T22:31:50.129394Z",
"url": "https://files.pythonhosted.org/packages/88/03/eb18f72dc6e6398e75e3762677f18ab3a773a384b18efd3ed9119844e892/profanityfilter-2.1.0-py2.py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8d0308740b5e0800f9eb9f675c149a497a3f3735e7b04e414bcce64136e7e487",
"md5": "0bf9e6dc1d1d403d2304696feead57b4",
"sha256": "0ede04e92a9d7255faa52b53776518edc6586dda828aca677c74b5994dfdd9d8"
},
"downloads": -1,
"filename": "profanityfilter-2.1.0.tar.gz",
"has_sig": false,
"md5_digest": "0bf9e6dc1d1d403d2304696feead57b4",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 7910,
"upload_time": "2024-11-25T22:31:51",
"upload_time_iso_8601": "2024-11-25T22:31:51.194300Z",
"url": "https://files.pythonhosted.org/packages/8d/03/08740b5e0800f9eb9f675c149a497a3f3735e7b04e414bcce64136e7e487/profanityfilter-2.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-25 22:31:51",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "areebbeigh",
"github_project": "profanityfilter",
"travis_ci": true,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "profanityfilter"
}