Pyluach: Hebrew (Jewish) Calendar Dates

2.3.0 · active · verified Fri Apr 10

Pyluach is a Python package designed for manipulating Hebrew (Jewish) calendar dates. It provides functionalities for converting between Hebrew and Gregorian dates, calculating date differences, finding weekdays, identifying weekly Torah readings (Parshios), and determining holidays. The library is actively maintained, with version 2.3.0 being the current stable release, and new minor versions released periodically.

Warnings

Install

Imports

Quickstart

This quickstart demonstrates how to get the current Hebrew date, convert between Gregorian and Hebrew dates, identify Jewish holidays, and retrieve the weekly Torah portion (Parsha) using `pyluach`.

from pyluach import dates, hebrewcal, parshios

# Get today's Hebrew date
today = dates.HebrewDate.today()
print(f"Today's Hebrew date: {today.hebrew_date_string(hebrew=True)}")
print(f"Today's Gregorian equivalent: {today.to_greg()}")

# Convert between Gregorian and Hebrew dates
greg_date = dates.GregorianDate(1986, 3, 21)
heb_date = greg_date.to_heb()
print(f"Gregorian {greg_date} is Hebrew {heb_date}")

# Check for holidays and parsha
rosh_hashana = dates.HebrewDate(5782, 7, 1)
print(f"Holiday on Rosh Hashana 5782: {rosh_hashana.holiday()}")

# Get weekly Torah portion
parsha_date = dates.GregorianDate(2021, 3, 10)
print(f"Parsha for {parsha_date}: {parshios.getparsha_string(parsha_date)}")

view raw JSON →