Bnlish
English to Bengali transliteration library
Description
Banglish is a Python library that provides transliteration from English (Roman script) to Bengali (Bangla script). It includes comprehensive character mappings for vowels, consonants, and vowel signs (kar), as well as a dictionary of common words.
Features
- Bidirectional transliteration: English to Bengali and Bengali to English
- Character-by-character transliteration with compound consonant support
- Support for Bengali vowels, consonants, and vowel signs
- Extensive common words dictionary (200+ words)
- Simple and easy-to-use API
- Word suggestions for incomplete typing
Installation
pip install bnlish
Usage
Three-Way Transliteration
Your Banglish library now supports three-way conversion between English, Banglish, and Bengali:
# Import all conversion functions
import banglish as bnlish
# 1. English to Banglish
english_text = "I am very good today"
banglish_text = bnlish.en_to_banglish(english_text)
print(banglish_text) # Output:
# 2. Banglish to English
banglish_text = "ridoye tomar kirtan baje"
english_text = bnlish.banglish_to_en(banglish_text)
print(english_text) # Output:
# 3. Banglish to Bengali
banglish_text = "ridoye tomar kirtan baje"
bengali_text = bnlish.banglish_to_bn(banglish_text)
print(bengali_text) # Output: হৃদয়ে তোমার কীর্তন বাজে
# 4. Bengali to Banglish
bengali_text = "হৃদয়ে তোমার কীর্তন বাজে"
banglish_text = bnlish.bn_to_banglish(bengali_text)
print(banglish_text) # Output: ridoye tomar kirtan baje
Advanced Usage
# For more control, use the translator class
import banglish as bnlish
translator = bnlish.BanglishTranslator()
# Direct method calls
print(translator.to_banglish("tumi kemon acho")) # English to Bengali
print(translator.to_banglish_from_bengali("তুমি কেমন আছো")) # Bengali to English
# Word suggestions
suggestions = translator.suggest("bha")
print(suggestions) # [{'english': 'bhalo', 'bangla': 'ভালো'}, ...]
Alternative imports (also available):
from bnlish import translate, bengali_to_banglish # Same functions, different names
Requirements
- Python 3.7+
- regex >= 2023.0.0
Development
Install development dependencies
pip install -e .[dev]
Run tests
pytest
Code formatting
black .
License
This project is licensed under the MIT License - see the LICENSE file for details.
Author
Debashish Roy thedeba@icloud.com
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Metadata
Release files for bnlish 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| bnlish-1.0.1.tar.gz | 12.0 kB | Without provenance | Details for bnlish-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| bnlish-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for bnlish-1.0.1-py3-none-any.whl |
Total release size: 22.8 kB
Release files / bnlish-1.0.1.tar.gz
| Download URL | bnlish-1.0.1.tar.gz |
|---|---|
| Size | 12.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
066927653e85af317d2b4256ae0a97c60b8c4865740c2599b85323b35907e369
|
|
BLAKE2b-256 checksum How to use checksums |
61e5232073074d4490431c6ec9c9f7d895a65a2625ae5b25872a73ce2f386513
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Release files / bnlish-1.0.1-py3-none-any.whl
| Download URL | bnlish-1.0.1-py3-none-any.whl |
|---|---|
| Size | 10.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0f8e0b2ec77c98d6fc55a5faf232b035dd041b9dfc75638db738306289c127ce
|
|
BLAKE2b-256 checksum How to use checksums |
d06c6a2b5d8fbaa3560d8f4ea5b2a68ac4c5cbe0688d09438ee8d8edbb0c0fb3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.0
|
Security for bnlish 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.