API Reference
This page contains auto-generated API reference documentation for the main classes of hijri-converter package.
- class Hijri(year, month, day, validate=True)[source]
Bases:
object
A Hijri object represents a date (year, month and day) in lunar Hijri calendar.
- Parameters:
- Raises:
OverflowError – When
year
is out of supported Hijri range.ValueError – When
month
is not within the range of 1..12.ValueError – When
day
is not within the range of 1..month_length for month.
- classmethod fromisoformat(date_string)[source]
Construct Hijri object from an ISO formatted Hijri date
YYYY-MM-DD
.
- dmyformat(separator='/', padding=True)[source]
Return date in day-month-year format (
DD/MM/YYYY
by default).
- class Gregorian[source]
Bases:
date
A Gregorian object represents a date (year, month and day) in Gregorian calendar.
- dmyformat(separator='/', padding=True)[source]
Return date in day-month-year format (
DD/MM/YYYY
by default).
- to_hijri()[source]
Return Hijri object for the corresponding Gregorian date.
- Raises:
OverflowError – When date is out of supported Gregorian range.
- Return type:
The following are the supported ranges by the Umm al-Qura calendar (defined at
hijri_converter.ummalqura
module):