Skip to main content

Bangla is a package for Bangla language users with various functionalities including Bangla date and Bangla numeric conversation.

Project description

Build Status Version Python Size Codecov

Bangla is a package for Bangla language users with various functionalities including Bangla date and Bangla numeric conversation.

It can be used to get Bangla date that includes year, month, date, weekday and season of Bangla year. Bangla has used the rules from Wikipedia https://en.wikipedia.org/wiki/Bengali_calendars to convert Gregorian date to Bangla date. It is based on the revised version of the Bengali calendar which was officially adopted in Bangladesh in 1987. Among the Bengali community in India, the provided date may differ.

Moreover, this package has also a method to convert English numeric string to Bangla numeric string.

This software can be used on Linux/Unix, Mac OS and Windows systems.

Features

  • Get Bangla date that includes:
    • Bangla Date (১-৩১)
    • Bangla Month (“বৈশাখ”, “জ্যৈষ্ঠ”, “আষাঢ়”, “শ্রাবণ”, “ভাদ্র”, “আশ্বিন”, “কার্তিক”, “অগ্রহায়ণ”, “পৌষ”, “মাঘ”, “ফাল্গুন”, “চৈত্র”)
    • Bangla Year (১৯৮৭ - )
    • Bangla Season (“গ্রীষ্ম”, “বর্ষা”, “শরৎ”, “হেমন্ত”, “শীত”, “বসন্ত”)
    • Bangla Weekday (“শনিবার”, “রবিবার”, “সোমবার”, “মঙ্গলবার”, “বুধবার”, “বৃহস্পতিবার”, “শুক্রবার”)
  • Convert English numeric string to Bangla numeric string (123456 -> ১২৩৪৫৬).

Installation

We recommend install bangla through pip install using Python 3.

$ pip install bangla

Example

To get today’s date in Bangla calendar:

import bangla
bangla_date = bangla.get_date()
print(bangla_date)
# Output: {'date': '৮', 'month': 'আষাঢ়', 'year': '১৪২৪', 'season': 'বর্ষা', 'weekday': 'বৃহস্পতিবার'}

To convert any Gregorian date to Bangla date :

import bangla
bangla_date = bangla.get_date(20,6,2017) # date, month, year
print(bangla_date)
# Output: {'date': '৬', 'month': 'আষাঢ়', 'year': '১৪২৪', 'season': 'বর্ষা', 'weekday': 'মঙ্গলবার'}

To convert any English numeric string to Bangla numeric string :

import bangla
bangla_numeric_string = bangla.convert_english_digit_to_bangla_digit("123456")
print(bangla_numeric_string)
# Output: ১২৩৪৫৬

Contribute

Create Github Pull Request https://github.com/arsho/bangla/pulls

If you have suggestion use GitHub issue system or send a message in Facebook https://www.facebook.com/ars.shovon.

Thanks

Influenced by বঙ্গাব্দ - jQuery Plugin https://github.com/nuhil/bangla-calendar

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
bangla-0.0.2-py2.py3-none-any.whl (6.2 kB) Copy SHA256 hash SHA256 Wheel py2.py3 Feb 15, 2018
bangla-0.0.2.tar.gz (4.0 kB) Copy SHA256 hash SHA256 Source None Feb 15, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page