Python Umalqurra Calender is an API that will give you the ability to convert Gregorian to Hijri and hijri to Gregorian
it will give you the day name in arabic and english , and the month name in Hijri arabic and Gregorian.
Thanks for Khalid Al-hussayen : https://pypi.python.org/pypi/umalqurra/0.2
- `Install <#install>`__
- `Features <#features>`__
- `Usage <#usage>`__
Install:
--------
::
sudo pip3 install ummalqura
Features:
---------
- Convert Gregorian to Hijri
- Convert Hijri to Gregorian
- give the arabic name of the hijri month
- give the english name of the gregorian month
- give the day name in Arabic and English
- give the current day both in Hijri and Gregorian
Usage
-----
::
#!/usr/bin/env python3
from ummalqura.hijri_date import HijriDate
from datetime import date
# create the object with Gregorian date
um = HijriDate(2017, 12, 26, gr=True)
# hijri month
print('hijri month: ', um.month) # 4
# Hijri year
print('hijri year: ', um.year) # 1439
# arabic day name
print('arabic day name: ', um.day_name) # الثلاثاء
# english day name
print('english day name: ', um.day_name_en) # Tuesday
# arabic hijri month name
print('arabic hijri month name: ', um.month_name) # ربيع الثاني
# english gregorian month name
print('english gregorian month name: ', um.month_name_gr) # December
# gregorian year
print('gregorian year: ', um.year_gr) # 2017
# gregorian month
print('gregorian month: ', um.month_gr) # 12
# gregorian day
print('gregorian day: ', um.day_gr) # 26
# current hijri month
print('current_month: ', HijriDate.current_month()) # 4
# the gregorian date corresponding to the first day of the given hijri month/year
print('first day: ', HijriDate.month_start_date(4)) # 2017-12-19
print('first day: ', HijriDate.month_start_date(4, 1439)) # 2017-12-19
# the gregorian date corresponding to the last day of the given hijri month/year
print('last day: ', HijriDate.month_end_date(4)) # 2018-01-17
print('last day: ', HijriDate.month_end_date(4, 1439)) # 2018-01-17
# the hijri month for the given gregorian date
print('hijri month: ', HijriDate.hijri_month_from_date(date.today())) # 4
# the hijri year for the given gregorian date
print('hijri year: ', HijriDate.hijri_year_from_date(date.today())) # 1439
# convert the given gregorian date to hijri date
print('hijri date: ', HijriDate.get_hijri_date(date.today())) # 1439-04-08
# convert the given hijri date to gregorian date
print('georing date: ', HijriDate.get_georing_date('1439-04-08')) # 2017-12-26
Raw data
{
"_id": null,
"home_page": "https://github.com/borni-dhifi/ummalqura",
"name": "ummalqura",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "ummalqura",
"author": "Borni DHIFI",
"author_email": "dhifi.borni@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/41/fe/d44e0cd296392ec5ddedd0780f8d66e44eeeb61238e2a21b48e743259160/ummalqura-2.0.1.tar.gz",
"platform": "",
"description": "\n\nPython Umalqurra Calender is an API that will give you the ability to convert Gregorian to Hijri and hijri to Gregorian\nit will give you the day name in arabic and english , and the month name in Hijri arabic and Gregorian.\n\nThanks for Khalid Al-hussayen : https://pypi.python.org/pypi/umalqurra/0.2 \n\n- `Install <#install>`__\n- `Features <#features>`__\n- `Usage <#usage>`__\n\nInstall: \n--------\n\n::\n\n\tsudo pip3 install ummalqura\n\nFeatures: \n---------\n\n- Convert Gregorian to Hijri\n\n- Convert Hijri to Gregorian\n\n- give the arabic name of the hijri month\n\n- give the english name of the gregorian month\n\n- give the day name in Arabic and English\n\n- give the current day both in Hijri and Gregorian\n\nUsage\n-----\n \n::\n\n\t#!/usr/bin/env python3\n\n\tfrom ummalqura.hijri_date import HijriDate\n\tfrom datetime import date\n\n\n\t# create the object with Gregorian date\n\tum = HijriDate(2017, 12, 26, gr=True)\n\n\t# hijri month\n\tprint('hijri month: ', um.month) # 4\n\t# Hijri year\n\tprint('hijri year: ', um.year) # 1439\n\t# arabic day name\n\tprint('arabic day name: ', um.day_name) # \u0627\u0644\u062b\u0644\u0627\u062b\u0627\u0621\n\t# english day name\n\tprint('english day name: ', um.day_name_en) # Tuesday\n\t# arabic hijri month name\n\tprint('arabic hijri month name: ', um.month_name) # \u0631\u0628\u064a\u0639 \u0627\u0644\u062b\u0627\u0646\u064a\n\t# english gregorian month name\n\tprint('english gregorian month name: ', um.month_name_gr) # December\n\t# gregorian year\n\tprint('gregorian year: ', um.year_gr) # 2017\n\t# gregorian month\n\tprint('gregorian month: ', um.month_gr) # 12\n\t# gregorian day\n\tprint('gregorian day: ', um.day_gr) # 26\n\n\t# current hijri month\n\tprint('current_month: ', HijriDate.current_month()) # 4\n\t# the gregorian date corresponding to the first day of the given hijri month/year\n\tprint('first day: ', HijriDate.month_start_date(4)) # 2017-12-19\n\tprint('first day: ', HijriDate.month_start_date(4, 1439)) # 2017-12-19\n\t# the gregorian date corresponding to the last day of the given hijri month/year\n\tprint('last day: ', HijriDate.month_end_date(4)) # 2018-01-17\n\tprint('last day: ', HijriDate.month_end_date(4, 1439)) # 2018-01-17\n\t# the hijri month for the given gregorian date\n\tprint('hijri month: ', HijriDate.hijri_month_from_date(date.today())) # 4\n\t# the hijri year for the given gregorian date\n\tprint('hijri year: ', HijriDate.hijri_year_from_date(date.today())) # 1439\n\t# convert the given gregorian date to hijri date\n\tprint('hijri date: ', HijriDate.get_hijri_date(date.today())) # 1439-04-08\n\t# convert the given hijri date to gregorian date\n\tprint('georing date: ', HijriDate.get_georing_date('1439-04-08')) # 2017-12-26\n\n\n",
"bugtrack_url": null,
"license": "Waqef",
"summary": "Python Hijri Ummalqura",
"version": "2.0.1",
"project_urls": {
"Homepage": "https://github.com/borni-dhifi/ummalqura"
},
"split_keywords": [
"ummalqura"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "41fed44e0cd296392ec5ddedd0780f8d66e44eeeb61238e2a21b48e743259160",
"md5": "4c2a7f5e52034e450bbdebb68189dbd5",
"sha256": "657ee9f4ee961a5f1381a2abb0c22801859fa6803533ccf6c888194e6b301d03"
},
"downloads": -1,
"filename": "ummalqura-2.0.1.tar.gz",
"has_sig": false,
"md5_digest": "4c2a7f5e52034e450bbdebb68189dbd5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10974,
"upload_time": "2017-12-26T13:04:04",
"upload_time_iso_8601": "2017-12-26T13:04:04.882177Z",
"url": "https://files.pythonhosted.org/packages/41/fe/d44e0cd296392ec5ddedd0780f8d66e44eeeb61238e2a21b48e743259160/ummalqura-2.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2017-12-26 13:04:04",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "borni-dhifi",
"github_project": "ummalqura",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "ummalqura"
}