Skip to main content

pybengali is a python3 package for Bengali DateTime and Bengali numeric number conversation and many more

Project description

PYBENGALI

pybengali is a python3 package for Bengali DateTime and Bengali numeric number conversation and many more. This package can be used with any python framework like Django, Flask, FastAPI, and others. pybengali is OS Independent, It can be used on any operating system Linux/Unix, Mac OS and Windows.

Available Features

  • Features available in pybengali:
  • List of Bengali Numbers
  • List of Bengali Months
  • List of Bengali Weekdays
  • List of Bengali Seasons
  • Bengali Year
  • Bengali Weekday
  • Bengali Date
  • Bengali Today
  • Bengali Tomorrow
  • Bengali Yesterday
  • Bengali Past Date
  • Bengali Future Date
  • Bengali Timesince
  • Convert English Month Name to Bengali
  • Convert English Numeric Number to Bengali Numeric Number

Installation

$ pip install pybengali

Usage

Get Bengali Today:

import pybengali
today = pybengali.today()
print(today)
# Output: {'date': '১৯', 'month': 'আশ্বিন', 'year': '১৪২৮', 'season': 'শরৎ', 'weekday': 'সোমবার'}

today = pybengali.today(day="04", month="10", year="2022")
print(today)
# Output: {'date': '১৯', 'month': 'আশ্বিন', 'year': '১৪২৯', 'season': 'শরৎ', 'weekday': 'মঙ্গলবার'}

Get Bengali Tomorrow and Yesterday:

import pybengali
tomorrow = pybengali.tomorrow()
print(tomorrow)
# Output: {'date': '২০', 'month': 'আশ্বিন', 'year': '১৪২৮', 'season': 'শরৎ', 'weekday': 'মঙ্গলবার'}

yesterday = pybengali.yesterday(day="04", month="10", year="2022")
print(yesterday)
# Output: {'date': '১৮', 'month': 'আশ্বিন', 'year': '১৪২৮', 'season': 'শরৎ', 'weekday': 'রবিবার'}

Get Bengali Timesince:

import pybengali
timesince = pybengali.timesince(day="04",month="10",year="2019")
print(timesince)
# Output: ২ বছর আগে

Get Bengali Past or Future Date With Number of Days To Go Back or Froward :

import pybengali
# Past Date
past_date = pybengali.past_date('2')
print(past_date)
# Output: {'date': '১৭', 'month': 'আশ্বিন', 'year': '১৪২৮', 'season': 'শরৎ', 'weekday': 'শনিবার'}

# Future Date
future_date = pybengali.future_date('2')
print(future_date)
# Output: {'date': '২১', 'month': 'আশ্বিন', 'year': '১৪২৮', 'season': 'শরৎ', 'weekday': 'বুধবার'}

Get Bengali Year:

import pybengali
year = pybengali.get_year(day="04", month="10", year="2021")
print(year)
# Output:  ১৪২৮

Get Bengali Weekday:

import pybengali
weekday = pybengali.get_weekday(day="04", month="10", year="2021")
print(weekday)
# Output:  সোমবার

Convert English Numeric Number to Bengali Numeric Number:

import pybengali
bengali_digit = pybengali.convert_e2b_digit("10")
print(bengali_digit)
# Output:  ১০

Convert English Month to Bengali Name:

import pybengali
bengali_name = pybengali.eng_month_to_bengali("1")
print(bengali_name)
# Output:  জানুয়ারী

Get List of Bengali Numbers:

import pybengali
numbers = pybengali.bengali_numbers()
print(numbers)
# Output:  ['০', '১', '২', '৩', '৪', '৫', '৬', '৭', '৮', '৯']

Get List of Bengali Months:

import pybengali
months = pybengali.bengali_months()
print(months)
# Output:  ['পৌষ', 'মাঘ', 'ফাল্গুন', 'চৈত্র', 'বৈশাখ', 'জ্যৈষ্ঠ', 'আষাঢ়', 'শ্রাবণ', 'ভাদ্র', 'আশ্বিন', 'কার্তিক', 'অগ্রহায়ণ']
# Months sequence Is accroding to English calender.

Get List of Bengali Weekdays:

import pybengali
weekdays = pybengali.bengali_weekdays()
print(weekdays)
# Output:  ['সোমবার', 'মঙ্গলবার', 'বুধবার', 'বৃহস্পতিবার', 'শুক্রবার', 'শনিবার', 'রবিবার']
# weekdays sequence Is accroding to English calender.

Get List of Bengali Seasons:

import pybengali
seasons = pybengali.bengali_seasons()
print(seasons)
# Output:  ['শীত', 'বসন্ত', 'গ্রীষ্ম', 'বর্ষা', 'শরৎ', 'হেমন্ত']
# seasons sequence Is accroding to English calender.

*pybengali is build based on Bengali calendar which was officially adopted in Bangladesh in 1987 and All the rules from Bengali_calendars to convert Gregorian date to Bangla date. *

Contribute

If you face any problem feel free to open issue.

Contact

If you have any suggestion: Email: pyshawon@gmail.com Facebook: https://www.facebook.com/pyshawon/

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

pybengali-0.0.1.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pybengali-0.0.1-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file pybengali-0.0.1.tar.gz.

File metadata

  • Download URL: pybengali-0.0.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.6

File hashes

Hashes for pybengali-0.0.1.tar.gz
Algorithm Hash digest
SHA256 d9f063c9ac5956d0cb293786f446fb6198c21b3ca2a37d924d9d027e2947491d
MD5 dd91d3f1f66f1e1d1f978ea8da4985ae
BLAKE2b-256 77557a95ed8d8b3b2a1722312df693eaf0ed4ef008663d8375c09338af83fda8

See more details on using hashes here.

File details

Details for the file pybengali-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pybengali-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.8.6

File hashes

Hashes for pybengali-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9810bf53e8f5b7c9242b80f7bc190f10035002e54bec1778537d63ad2245be93
MD5 f1051c6b8d4c616058b115106debd4eb
BLAKE2b-256 f8a252fe36f61bf6c45f01bb7169d174fa6deb7fe8e45b9f1eeccfc638b30fbc

See more details on using hashes here.

Supported by

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