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.

Source Distribution

bangla-0.0.2.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

bangla-0.0.2-py2.py3-none-any.whl (6.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file bangla-0.0.2.tar.gz.

File metadata

  • Download URL: bangla-0.0.2.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bangla-0.0.2.tar.gz
Algorithm Hash digest
SHA256 17c8fd501321660077d5ab6a79b746bba71f9e4939ef78ac0d9a75d7bd715da8
MD5 77921632c8eb11b59f18092e29200d18
BLAKE2b-256 df2ac4bded720ac03d7797b6abeee0a404b8ebb5ccce48863430c36bb8bf505a

See more details on using hashes here.

File details

Details for the file bangla-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for bangla-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 60c52bb4614894de4a91ee997bf950d03545d1fb9b01196577ce04ed4fa00ff8
MD5 cc81c50c4d325b839e42cf2af664480b
BLAKE2b-256 ea2a0dc2b2112f2cdac8694f1f782b4ea45a0693e453b76e21f224bad340591d

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