DEV Community

Cover image for I built bhasha-kit: a free offline Python library for Hindi & Bengali text
Solo Developer
Solo Developer

Posted on

I built bhasha-kit: a free offline Python library for Hindi & Bengali text

Hi everyone! I'm Solo Developer. I just published my first Python package, bhasha-kit, a free, offline toolkit for Hindi, Bengali and English text.

Why I built it

Most text tools need an API key or an internet connection, and many don't handle Hindi and Bengali well. I wanted something simple that runs locally, with no dependencies.

What it does

  • Cleans text (emojis, extra spaces, Unicode)
  • Detects Hindi / Bengali / English
  • Transliterates Roman ↔ Devanagari / Bengali
  • Converts numbers to words, including rupees and paise
  • Basic sentiment analysis and keyword extraction

Install

pip install bhasha-kit
Enter fullscreen mode Exit fullscreen mode

Quick examples

from bhasha_kit import clean_text, number_to_words, analyze_sentiment

clean_text("नमस्ते   😀 दोस्तों")
# 'नमस्ते दोस्तों'

number_to_words(1250, "hi")
# 'एक हज़ार दो सौ पचास'

number_to_words(1250, "bn")
# 'এক হাজার দুই শত পঞ্চাশ'

analyze_sentiment("this is not good")
# {'label': 'negative', 'score': -1.0, 'lang': 'en'}
Enter fullscreen mode Exit fullscreen mode

Known limitations

  • Transliteration is rule-based and approximate.
  • Sentiment uses a small word list and doesn't understand sarcasm or context.

Links

It's an early version (0.2.0). I'd love your feedback: try it, test it, and tell me about any bugs. A ⭐ on GitHub would help a lot. Thank you!

Top comments (0)