Skip to main content

Rule-based profanity checking tool for English and Turkish.

Project description

🤔 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:

pip install safetext

🎯 quickstart

check and censor profanity

>>> 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:
>>> 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:
>>> 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.

📞 contact

for inquiries or support, reach out via email or visit our website SafeVideo.

🤝 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 for more.


🏆 contributors

meet our awesome contributors who make safetext better every day!


follow us for more!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

safetext-0.0.8.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

safetext-0.0.8-py3-none-any.whl (15.8 kB view details)

Uploaded Python 3

File details

Details for the file safetext-0.0.8.tar.gz.

File metadata

  • Download URL: safetext-0.0.8.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for safetext-0.0.8.tar.gz
Algorithm Hash digest
SHA256 51531e188046f79ec7cbaf0f7b136c2147ce027113cee6bf03c638ecde84d3b6
MD5 e1012f980110dff1bf9bd792d7d4625e
BLAKE2b-256 e974b280fc942ef199639c622a7db7e2d5c7a57293ebf026d2e32b2d5108b94a

See more details on using hashes here.

File details

Details for the file safetext-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: safetext-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 15.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for safetext-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 9954715b37d6ce87013acb74c65b8aa53d5d9a31e3b83ace7e9aa1203ed72265
MD5 2808f0855de3f01885042f12d06f0c9d
BLAKE2b-256 2f9080c084b7b2226afff1217c660819d847d5c6c1812b2bc926d150bb1469b6

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page