A Python package for accurate Hijri-Gregorian date conversion based on the Umm al-Qura calendar. It offers reliable date conversion, optimized performance, and multilingual support. The current version is 2.6.0 and it is actively maintained with a regular release cadence, including support for new Python versions.
pip install hijridateVerified import paths — ran on the pinned version, not inferred.
Initialize `Hijri` or `Gregorian` objects and use their `to_gregorian()` or `to_hijri()` methods for conversion. The `Hijri.today()` class method provides the current Hijri date.
Update your `pip install` command to `pip install hijridate` and modify all import statements from `from hijri_converter import ...` to `from hijridate import ...`.
Upgrade your Python environment to 3.10 or newer for `hijridate` versions 2.6.0 and above. For earlier `hijridate` versions, ensure you meet their specific Python requirements (e.g., Python 3.8+ for v2.5.0).
When instantiating `Hijri` or `Gregorian` objects (e.g., `Hijri(1445, 6, 15, validate=True)`) or calling `dmyformat()` (e.g., `date_obj.dmyformat(padding=False)`), use keyword arguments for these parameters instead of positional ones.
Replace calls to `date_obj.slashformat()` with `date_obj.dmyformat(separator='/')` to achieve the same formatting.
Users should be aware of the supported date range and the library's intended use. For dates outside this range or for religious sighting, alternative solutions may be required.
Pass the year, month, and day as individual integers, or use the `Gregorian.fromdate()` class method if you have a `datetime.date` or `datetime.datetime` object.
Install the correct package (`pip install hijridate`) and import from `hijridate`.
Ensure you understand that `hijridate` strictly follows the Umm al-Qura calendar. If your expected date differs by a day, it's likely due to a different calendar standard or a local adjustment for moon sightings. The library's calculations are accurate according to its specified calendar system.