API Reference
Jewish calendrical date and times for a given location.
HDate calculates and generates a representation either in English or Hebrew of the Jewish calendrical date and times for a given location
- class hdate.HDateInfo(date: ~datetime.date | ~hdate.hebrew_date.HebrewDate = <factory>, diaspora: bool = False, nusach: ~typing.Literal['sephardi', 'ashkenazi'] = 'sephardi')[source]
Bases:
TranslatorMixinHebrew date information class.
Provides access to various properties of a given date.
- property daf_yomi: Masechta
Return the daf yomi for the given date.
- date: date | HebrewDate
- diaspora: bool = False
- property first_day: HDateInfo
Return the first day of Yom Tov or Shabbat.
This is useful for three-day holidays, for example: it will return the first in a string of Yom Tov + Shabbat. If this HDateInfo is Shabbat followed by no Yom Tov, returns the Saturday. If this HDateInfo is neither Yom Tov, nor Shabbat, this just returns itself.
- property gdate: date
Return the Gregorian date for the given Hebrew date.
- property gevurot_geshamim: str
Return the rain prayer (Tal uMatar, veTen Beracha, …).
- property hdate: HebrewDate
Return the hebrew date.
- property holidays: list[Holiday]
Return the abstract holiday information from holidays table.
- property is_holiday: bool
Return True if this date is a holiday (any kind).
- property is_shabbat: bool
Return True if this date is Shabbat.
Returns False on Friday because the HDate object has no notion of time. For more detailed nuance, use the Zmanim object.
- property is_yom_tov: bool
Return True if this date is a Yom Tov.
- property last_day: HDateInfo
Return the last day of Yom Tov or Shabbat.
This is useful for three-day holidays, for example: it will return the last in a string of Yom Tov + Shabbat. If this HDate is Shabbat followed by no Yom Tov, returns the Saturday. If this HDate is neither Yom Tov, nor Shabbat, this just returns itself.
- nusach: Literal['sephardi', 'ashkenazi'] = 'sephardi'
- property omer: Omer | None
Return the Omer object.
- property parasha: Parasha
Return the upcoming parasha.
- property upcoming_erev_shabbat: HDateInfo
Return the HDateInfo for the upcoming or current Erev Shabbat (Friday).
- property upcoming_erev_shabbat_or_erev_yom_tov: HDateInfo
Return the HDateInfo for upcoming or current Erev Shabbat or Erev Yom Tov.
- property upcoming_erev_yom_tov: HDateInfo
Return the HDateInfo for the upcoming or current Erev Yom Tov.
- property upcoming_shabbat: HDateInfo
Return the HDateInfo for either the upcoming or current Shabbat.
- class hdate.HebrewDate(year: int = 0, month: Months = Months.TISHREI, day: int = 1)[source]
Bases:
TranslatorMixinDefine a Hebrew date object.
- day: int = 1
- static from_gdate(date: date) HebrewDate[source]
Return Hebrew date from Gregorian date.
- static from_jdn(jdn: int) HebrewDate[source]
Convert from the Julian day to the Hebrew day.
- replace(year: int | None = None, month: Months | None = None, day: int | None = None) HebrewDate[source]
Return a new HebrewDate with a different year/month/day.
- year: int = 0
- class hdate.HolidayTypes(*values)[source]
Bases:
EnumContainer class for holiday type integer mappings.
- EREV_YOM_TOV = 2
- FAST_DAY = 5
- HOL_HAMOED = 3
- ISRAEL_NATIONAL_HOLIDAY = 9
- MELACHA_PERMITTED_HOLIDAY = 4
- MEMORIAL_DAY = 8
- MINOR_HOLIDAY = 7
- MODERN_HOLIDAY = 6
- ROSH_CHODESH = 10
- YOM_TOV = 1
- class hdate.Location(name: str = 'Jerusalem', latitude: float = 31.778, longitude: float = 35.235, timezone: str | tzinfo = zoneinfo.ZoneInfo(key='Asia/Jerusalem'), altitude: float = 754, diaspora: bool = False)[source]
Bases:
objectDefine a geolocation for Zmanim calculations.
- altitude: float = 754
- diaspora: bool = False
- latitude: float = 31.778
- longitude: float = 35.235
- name: str = 'Jerusalem'
- timezone: str | tzinfo = zoneinfo.ZoneInfo(key='Asia/Jerusalem')
- class hdate.Months(*values)[source]
Bases:
TranslatorMixin,IntEnumEnum class for the Hebrew months.
- ADAR = 6
- ADAR_I = 7
- ADAR_II = 8
- AV = 13
- ELUL = 14
- IYYAR = 10
- KISLEV = 3
- MARCHESHVAN = 2
- NISAN = 9
- SHVAT = 5
- SIVAN = 11
- TAMMUZ = 12
- TEVET = 4
- TISHREI = 1
- class hdate.Zmanim(date: ~datetime.date = <factory>, location: ~hdate.location.Location = <factory>, candle_lighting_offset: int = 18, havdalah_offset: int = 0)[source]
Bases:
TranslatorMixinReturn Jewish day times.
The Zmanim class returns times for the specified day ONLY. If you wish to obtain times for the interval of a multi-day holiday for example, you need to use Zmanim in conjunction with some of the iterative properties of HDate. Also, Zmanim are reported regardless of the current time. So the havdalah value is constant if the current time is before or after it. The current time is only used to report the “issur_melacha_in_effect” property.
- property candle_lighting: datetime | None
Return the time for candle lighting, or None if not applicable.
- candle_lighting_offset: int = 18
- date: date
- erev_shabbat_chag(time: datetime) bool[source]
At the given time, return whether erev shabbat or chag
- property havdalah: datetime | None
Return the time for havdalah, or None if not applicable.
If havdalah_offset is 0, uses the time for three_stars. Otherwise, adds the offset to the time of sunset and uses that. If it’s currently a multi-day YomTov, and the end of the stretch is after today, the havdalah value is defined to be None (to avoid misleading the user that melacha is permitted).
- havdalah_offset: int = 0
- issur_melacha_in_effect(time: datetime) bool[source]
At the given time, return whether issur melacha is in effect.
- motzei_shabbat_chag(time: datetime) bool[source]
At the given time, return whether motzei shabbat or chag
- property zmanim: dict[str, Zman]
Return a list of Jewish times for the given location.