<div align="center">
<p>
<a align="center" href="" target="_blank">
<img
width="1280"
src="https://github.com/safevideo/safetext/assets/44926076/9af66dde-3a93-4c5b-b802-cb31dffcb2e5"
>
</a>
</p>
[](https://badge.fury.io/py/safetext)
[](https://pepy.tech/project/safetext)
[](LICENSE)
</div>
## 🤔 why safetext?
**Detect. Filter. Protect.**
- **Effortless Profanity Management**: Instantly identify and censor profanity with just one line of code.
- **Multilingual Capability**: Fluent in five languages, designed for easy expansion.
- **Optimized for Content Moderation**: Perfect for efficiently moderating and cleaning up text in various applications.
- **Automated**: Smart language detection for quick setup.
## 📦 installation
easily install **safetext** with pip:
```bash
pip install safetext
```
## 🎯 quickstart
### check and censor profanity
```python
>>> from safetext import SafeText
>>> st = SafeText(language='en')
>>> results = st.check_profanity(text='Some text with <profanity-word>.')
>>> results
{'word': '<profanity-word>', 'index': 4, 'start': 15, 'end': 31}
>>> text = st.censor_profanity(text='Some text with <profanity-word>.')
>>> text
"Some text with ***."
```
### automated language detection
- from text:
```python
>>> from safetext import SafeText
>>> eng_text = "This story is about to take a dark turn."
>>> st = SafeText(language=None)
>>> st.set_language_from_text(eng_text)
>>> st.language
'en'
```
- from .srt (subtitle) file:
```python
>>> from safetext import SafeText
>>> turkish_srt_file_path = "turkish.srt"
>>> st = SafeText(language=None)
>>> st.set_language_from_srt(turkish_srt_file_path)
>>> st.language
'tr'
```
## 📜 license
**safetext** is proudly open-source, available under the [MIT License](LICENSE).
## 📞 contact
for inquiries or support, reach out via [email](mailto:support@safevideo.ai) or visit our website [SafeVideo](https://safevideo.ai/).
## 🤝 contribute to safetext
join our mission in refining content moderation!
contribute by:
- **adding new languages**: create a folder with the ISO 639-1 code and include a `words.txt`.
- **enhancing word lists**: improve detection accuracy.
- **sharing feedback**: your ideas can shape `safetext`.
see our [contributing guidelines](CONTRIBUTING.md) for more.
______________________________________________________________________
## 🏆 contributors
meet our awesome contributors who make **safetext** better every day!
<p align="center">
<a href="https://github.com/safevideo/safetext/graphs/contributors">
<img src="https://contrib.rocks/image?repo=safevideo/safetext" />
</a>
</p>
______________________________________________________________________
<div align="center">
<b>follow us for more!</b>
<br>
<a href="https://www.linkedin.com/company/safevideo/">
<img
src="https://user-images.githubusercontent.com/44926076/278822352-30e06f9b-1915-4aed-8081-6796432daa7a.png"
height="32px"
/>
</a>
<a href="https://huggingface.co/safevideo">
<img
src="https://user-images.githubusercontent.com/34196005/278877706-ed074c9c-0938-48a1-98e8-39a322faf01d.png"
height="32px"
/>
</a>
<a href="https://twitter.com/safevideo_ai">
<img
src="https://user-images.githubusercontent.com/34196005/278877049-141925a9-aa1b-4730-829e-74f6d08ee8ca.png"
height="32px"
/>
</a>
</div>
Raw data
{
"_id": null,
"home_page": "https://github.com/deepsafe/safetext",
"name": "safetext",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "text, profanity, filtering, turkish, english",
"author": null,
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/c4/a7/b1c426c8ea18e42f743faa3866c8fd23696dad61fd93b70a5ac7b0fcf89f/safetext-0.1.0.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n <p>\n <a align=\"center\" href=\"\" target=\"_blank\">\n <img\n width=\"1280\"\n src=\"https://github.com/safevideo/safetext/assets/44926076/9af66dde-3a93-4c5b-b802-cb31dffcb2e5\"\n >\n </a>\n </p>\n\n[](https://badge.fury.io/py/safetext)\n[](https://pepy.tech/project/safetext)\n[](LICENSE)\n\n</div>\n\n## \ud83e\udd14 why safetext?\n\n**Detect. Filter. Protect.**\n\n- **Effortless Profanity Management**: Instantly identify and censor profanity with just one line of code.\n- **Multilingual Capability**: Fluent in five languages, designed for easy expansion.\n- **Optimized for Content Moderation**: Perfect for efficiently moderating and cleaning up text in various applications.\n- **Automated**: Smart language detection for quick setup.\n\n## \ud83d\udce6 installation\n\neasily install **safetext** with pip:\n\n```bash\npip install safetext\n```\n\n## \ud83c\udfaf quickstart\n\n### check and censor profanity\n\n```python\n>>> from safetext import SafeText\n\n>>> st = SafeText(language='en')\n\n>>> results = st.check_profanity(text='Some text with <profanity-word>.')\n>>> results\n{'word': '<profanity-word>', 'index': 4, 'start': 15, 'end': 31}\n\n>>> text = st.censor_profanity(text='Some text with <profanity-word>.')\n>>> text\n\"Some text with ***.\"\n```\n\n### automated language detection\n\n- from text:\n\n```python\n>>> from safetext import SafeText\n\n>>> eng_text = \"This story is about to take a dark turn.\"\n\n>>> st = SafeText(language=None)\n>>> st.set_language_from_text(eng_text)\n\n>>> st.language\n'en'\n```\n\n- from .srt (subtitle) file:\n\n```python\n>>> from safetext import SafeText\n\n>>> turkish_srt_file_path = \"turkish.srt\"\n\n>>> st = SafeText(language=None)\n>>> st.set_language_from_srt(turkish_srt_file_path)\n\n>>> st.language\n'tr'\n```\n\n## \ud83d\udcdc license\n\n**safetext** is proudly open-source, available under the [MIT License](LICENSE).\n\n## \ud83d\udcde contact\n\nfor inquiries or support, reach out via [email](mailto:support@safevideo.ai) or visit our website [SafeVideo](https://safevideo.ai/).\n\n## \ud83e\udd1d contribute to safetext\n\njoin our mission in refining content moderation!\n\ncontribute by:\n\n- **adding new languages**: create a folder with the ISO 639-1 code and include a `words.txt`.\n- **enhancing word lists**: improve detection accuracy.\n- **sharing feedback**: your ideas can shape `safetext`.\n\nsee our [contributing guidelines](CONTRIBUTING.md) for more.\n\n______________________________________________________________________\n\n## \ud83c\udfc6 contributors\n\nmeet our awesome contributors who make **safetext** better every day!\n\n<p align=\"center\">\n <a href=\"https://github.com/safevideo/safetext/graphs/contributors\">\n <img src=\"https://contrib.rocks/image?repo=safevideo/safetext\" />\n </a>\n</p>\n\n______________________________________________________________________\n\n<div align=\"center\">\n <b>follow us for more!</b>\n <br>\n <a href=\"https://www.linkedin.com/company/safevideo/\">\n <img\n src=\"https://user-images.githubusercontent.com/44926076/278822352-30e06f9b-1915-4aed-8081-6796432daa7a.png\"\n height=\"32px\"\n />\n </a>\n <a href=\"https://huggingface.co/safevideo\">\n <img\n src=\"https://user-images.githubusercontent.com/34196005/278877706-ed074c9c-0938-48a1-98e8-39a322faf01d.png\"\n height=\"32px\"\n />\n </a>\n <a href=\"https://twitter.com/safevideo_ai\">\n <img\n src=\"https://user-images.githubusercontent.com/34196005/278877049-141925a9-aa1b-4730-829e-74f6d08ee8ca.png\"\n height=\"32px\"\n />\n </a>\n</div>\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Rule-based profanity checking tool for English and Turkish.",
"version": "0.1.0",
"project_urls": {
"Homepage": "https://github.com/deepsafe/safetext"
},
"split_keywords": [
"text",
" profanity",
" filtering",
" turkish",
" english"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ea9a783737493b1449c8b0eeccdbc404fc45270e220abc2fc63aba929171673b",
"md5": "c0c3529c9af3fb006eda433ab9ab70d3",
"sha256": "e4223eb743371931adbf04b1984b10b241f5b8d94f6bc762daaa2f8dec4e421d"
},
"downloads": -1,
"filename": "safetext-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "c0c3529c9af3fb006eda433ab9ab70d3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 16441,
"upload_time": "2025-01-01T16:44:06",
"upload_time_iso_8601": "2025-01-01T16:44:06.569635Z",
"url": "https://files.pythonhosted.org/packages/ea/9a/783737493b1449c8b0eeccdbc404fc45270e220abc2fc63aba929171673b/safetext-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c4a7b1c426c8ea18e42f743faa3866c8fd23696dad61fd93b70a5ac7b0fcf89f",
"md5": "4b9b3fc8dc80c833c7ed93d081092ac0",
"sha256": "0653c32daed7efbfe5190bf1eb7a6df98474b138f3d0ddda8ae4e75b6aee15c5"
},
"downloads": -1,
"filename": "safetext-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "4b9b3fc8dc80c833c7ed93d081092ac0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 19484,
"upload_time": "2025-01-01T16:44:08",
"upload_time_iso_8601": "2025-01-01T16:44:08.980733Z",
"url": "https://files.pythonhosted.org/packages/c4/a7/b1c426c8ea18e42f743faa3866c8fd23696dad61fd93b70a5ac7b0fcf89f/safetext-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-01-01 16:44:08",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "deepsafe",
"github_project": "safetext",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [
{
"name": "lingua-language-detector",
"specs": [
[
"==",
"1.4.0"
]
]
},
{
"name": "pysrt",
"specs": []
},
{
"name": "requests",
"specs": []
},
{
"name": "python-dotenv",
"specs": []
}
],
"lcname": "safetext"
}