{"id":18709233,"url":"https://github.com/jojoee/leo-profanity-python","last_synced_at":"2025-04-12T10:35:12.720Z","repository":{"id":62575657,"uuid":"85537416","full_name":"jojoee/leo-profanity-python","owner":"jojoee","description":":tiger: Profanity filter, based on \"Shutterstock\" dictionary (Python version)","archived":false,"fork":false,"pushed_at":"2020-05-03T14:55:44.000Z","size":15,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-01T14:24:23.132Z","etag":null,"topics":["bad","curse","dirty","obscene","profanity","swear"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/leoprofanity/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jojoee.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-03-20T05:09:10.000Z","updated_at":"2023-05-25T02:41:50.000Z","dependencies_parsed_at":"2022-11-03T18:56:36.698Z","dependency_job_id":null,"html_url":"https://github.com/jojoee/leo-profanity-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoee%2Fleo-profanity-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoee%2Fleo-profanity-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoee%2Fleo-profanity-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jojoee%2Fleo-profanity-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jojoee","download_url":"https://codeload.github.com/jojoee/leo-profanity-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248553902,"owners_count":21123544,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bad","curse","dirty","obscene","profanity","swear"],"created_at":"2024-11-07T12:26:48.885Z","updated_at":"2025-04-12T10:35:12.472Z","avatar_url":"https://github.com/jojoee.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LeoProfanity\n\n[![Travis](https://img.shields.io/travis/jojoee/leo-profanity.svg)](https://travis-ci.org/jojoee/leo-profanity)\n[![PyPI version fury.io](https://badge.fury.io/py/leoprofanity.svg)](https://pypi.python.org/pypi/leoprofanity/)\n[![PyPI license](https://img.shields.io/pypi/l/leoprofanity.svg)](https://pypi.python.org/pypi/leoprofanity/)\n[![PyPI pyversions](https://img.shields.io/pypi/pyversions/leoprofanity.svg)](https://pypi.python.org/pypi/leoprofanity/)\n\nPython version of [leo-profanity](https://github.com/jojoee/leo-profanity), \"Shutterstock\" dictionary based filter.\n\n## Installation\n\n```\npip install leoprofanity\n\n# or\ngit clone https://github.com/jojoee/leo-profanity-python\ncd leo-profanity-python\npython setup.py install\n```\n\n## Usage\n\n### CLI\n\n```bash\npython -m leoprofanity \"I have boob\"\n```\n\n### Python\n```python\nfrom leoprofanity import LeoProfanity\n\n# example usage\nfil = LeoProfanity()\nfil.check(\"I have BoOb, etc.\") # True\nfil.clean(\"I have BoOb, etc.\") # 'I have ****, etc.'\n\n# return all profanity words (List[str])\nfil.list()\n\n# remove word form the list\nfil.remove_word(\"boob\")\n\n# check whether the string contains profanity word or not\nfil.check(\"Buy classic watches online\") # False\nfil.check(\"I have BoOb.\") # True\n\n# clean or replace profanity word in a string\nfil.clean(\"I have boob, etc.\") # \"I have ****\"\nfil.clean(\"I have boob,boob, ass, and etc.\") # \"I have ****,****, ***, and etc.\"\nfil.clean(\"I have boob\", \"+\") # \"I have ++++\"\nfil.clean(\"Buy classic watches online\") # \"Buy classic watches online\"\n\n# add new word(s)\nfil.add(\"b00b\")\nfil.add([\"b@@b\", \"b##b\"])\n\n# remove word(s) from the list\nfil.remove(\"boob\")\nfil.remove([\"boob\", \"boobs\"])\n\n# reset word list by using en dictionary\nfil.reset()\n\n# remove all words inside an existing list\nfil.clear_list()\n\n# return word list from dictionary\nfil.get_dictionary() # returns \"en\" word list\nfil.get_dictionary(\"en\")\n\n# reset word list by using en dictionary\nfil.load_dictionary()\nfil.load_dictionary(\"en\")\n```\n\n## Contribution\n\n```\n# env\nconda env list\nconda create --name leoprofanity python=3.7\n\n# test\npython -m unittest tests/*.py # run unit test\n\n# format\nflake8 --max-line-length=120 --exclude=__*.py\nblack . --check\npytype ./leoprofanity\n\n# publishing\npip install twine # package for publishing\npython setup.py sdist bdist_wheel # build the package\ntar tzf dist/leoprofanity-0.0.1.tar.gz # check published file in the published package\ntwine check dist/* # if the package render correctly\npython -m pip install dist/leoprofanity-0.0.1-py3-none-any.whl # for testing, install local to global\npython -m leoprofanity \"I have boob, etc.\" # testing the package via cli\ntwine upload --repository-url https://test.pypi.org/legacy/ dist/* --verbose # publishing (test)\ntwine upload dist/* # publishing\npip install leoprofanity -U # force update module to test after publishing\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjojoee%2Fleo-profanity-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjojoee%2Fleo-profanity-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjojoee%2Fleo-profanity-python/lists"}