hijri-converter

2.3.2.post1 · deprecated · verified Fri Apr 10

hijri-converter is a Python package designed for accurate conversions between Hijri (Islamic) and Gregorian dates, primarily based on the Umm al-Qura calendar. While it provided robust date conversion features, it is now deprecated in favor of the `hijridate` package. The current version is 2.3.2.post1, and it is no longer actively maintained, with future development and support continuing under `hijridate`.

Warnings

Install

Imports

Quickstart

This example demonstrates how to convert dates between Hijri and Gregorian calendars using the `Hijri` and `Gregorian` classes. Both date systems allow conversion to the other.

from hijri_converter import Hijri, Gregorian

# Convert a Hijri date to Gregorian
h_date = Hijri(1403, 2, 17)
g_date = h_date.to_gregorian()
print(f"Hijri 1403-02-17 is Gregorian: {g_date}")

# Convert a Gregorian date to Hijri
g_date_input = Gregorian(1982, 12, 2)
h_date_output = g_date_input.to_hijri()
print(f"Gregorian 1982-12-02 is Hijri: {h_date_output}")

view raw JSON →