Skip to main content

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:

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

Release files for ummalqura 2.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ummalqura 2.0.1
File Size Uploaded
ummalqura-2.0.1.tar.gz 11.0 kB Details

Release files / ummalqura-2.0.1.tar.gz

Download URL ummalqura-2.0.1.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
657ee9f4ee961a5f1381a2abb0c22801859fa6803533ccf6c888194e6b301d03
BLAKE2b-256 checksum
How to use checksums
41fed44e0cd296392ec5ddedd0780f8d66e44eeeb61238e2a21b48e743259160
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

2.0.1 This release

1 release file

2.0

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page