hebrewcal module

class pyluach.hebrewcal.Month(year, month)[source]

Bases: object

A Month object represents a month of the Hebrew calendar.

It provides the same operators as a Year object.

Parameters
  • year (int) –

  • month (int) – The month as an integer starting with 7 for Tishrei through 13 if necessary for Adar Sheni and then 1-6 for Nissan - Elul.

year

The Hebrew year.

Type

int

month

The month as an integer starting with 7 for Tishrei through 13 if necessary for Adar Sheni and then 1-6 for Nissan - Elul.

Type

int

name

The name of the month.

Type

str

iterdates()[source]

Return iterator that yields an instance of HebrewDate.

Yields

HebrewDate – The next Hebrew Date of the year starting the first day of Tishrei through the last day of Ellul.

molad()[source]

Return the month’s molad.

Returns

A dictionary in the form {weekday: int, hours: int, parts: int}

Return type

dict

Notes

This method does not return the molad in the form that is traditionally announced in the shul. This is the molad in the form used to calculate the length of the year.

See also

molad_announcement()

The molad as it is traditionally announced.

molad_announcement()[source]

Return the months molad in the announcement form.

Returns a dictionary in the form that the molad is traditionally announced. The weekday is adjusted to change at midnight and the hour of the day and minutes are given as traditionally announced. Note that the hour is given as in a twenty four hour clock ie. 0 for 12:00 AM through 23 for 11:00 PM.

Returns

A dictionary in the form

{
    weekday: int,
    hour: int,
    minutes: int,
    parts: int
}

Return type

dict

starting_weekday()[source]

Return first weekday of the month.

Returns

The weekday of the first day of the month starting with Sunday as 1 through Saturday as 7.

Return type

int

class pyluach.hebrewcal.Year(year)[source]

Bases: object

A Year object represents a Hebrew calendar year.

It provided the following operators:

Operation

Result

year2 = year1 + int

New Year int days after year1.

year2 = year1 - int

New Year int days before year1.

int = year1 - year2

int equal to the absolute value of the difference between year2 and year1.

bool = year1 == year2

True if year1 represents the same year as year2.

bool = year1 > year2

True if year1 is later than year2.

bool = year1 >= year2

True if year1 is later or equal to year2.

bool = year1 < year2

True if year 1 earlier than year2.

bool = year1 <= year2

True if year 1 earlier or equal to year 2.

Parameters

year (int) – A Hebrew year.

year

The hebrew year.

Type

int

leap

True if the year is a leap year else false.

Type

bool

iterdates()[source]

Yield HebrewDate instance for each day of the year.

Yields

HebrewDate – The next date of the Hebrew calendar year starting with the first of Tishrei.

iterdays()[source]

Yield integer for each day of the year.

Yields

int – An integer beginning with 1 representing the next day of the year.

itermonths()[source]

Yield Month instance for each month of the year.

Yields

Month – The next month in the Hebrew calendar year as a luachcal.hebrewcal.Month instance beginning with Tishrei and ending with Elul.

pyluach.hebrewcal.holiday(date, israel=False)[source]

Return Jewish holiday of given date.

The holidays include the major and minor religious Jewish holidays including fast days.

Parameters
  • date (HebrewDate, GregorianDate, or JulianDay) – Any date that implements a to_heb() method which returns a HebrewDate can be used.

  • israel (boolian, optional) – True if you want the holidays according to the israel schedule. Defaults to False.

Returns

The name of the holiday or None if the given date is not a Jewish holiday.

Return type

str or None